summaryrefslogtreecommitdiff
path: root/cipher/hash-common.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-02-04 20:21:45 +0100
committerWerner Koch <wk@gnupg.org>2011-02-04 20:21:45 +0100
commit4f048514ecae879fa4bb7b8522baf801229be522 (patch)
treed798c8527b68e83e4419c14d7c6dd47f2abdfd9e /cipher/hash-common.c
parent9d00b28e0d04361fe9ccf02983bea781b5701c1d (diff)
downloadlibgcrypt-4f048514ecae879fa4bb7b8522baf801229be522.tar.gz
Nuked almost all trailing whitespace.
Check and install the standard git pre-commit hook.
Diffstat (limited to 'cipher/hash-common.c')
-rw-r--r--cipher/hash-common.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/cipher/hash-common.c b/cipher/hash-common.c
index 656e180e..8c413bcb 100644
--- a/cipher/hash-common.c
+++ b/cipher/hash-common.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_STDINT_H
+#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
@@ -35,10 +35,10 @@
describing the error.
DATAMODE controls what will be hashed according to this table:
-
+
0 - Hash the supplied DATA of DATALEN.
1 - Hash one million times a 'a'. DATA and DATALEN are ignored.
-
+
*/
const char *
_gcry_hash_selftest_check_one (int algo,
@@ -49,14 +49,14 @@ _gcry_hash_selftest_check_one (int algo,
gcry_error_t err = 0;
gcry_md_hd_t hd;
unsigned char *digest;
-
+
if (_gcry_md_get_algo_dlen (algo) != expectlen)
return "digest size does not match expected size";
-
+
err = _gcry_md_open (&hd, algo, 0);
if (err)
return "gcry_md_open failed";
-
+
switch (datamode)
{
case 0:
@@ -64,7 +64,7 @@ _gcry_hash_selftest_check_one (int algo,
break;
case 1: /* Hash one million times an "a". */
- {
+ {
char aaa[1000];
int i;
@@ -82,7 +82,7 @@ _gcry_hash_selftest_check_one (int algo,
if (!result)
{
digest = _gcry_md_read (hd, algo);
-
+
if ( memcmp (digest, expect, expectlen) )
result = "digest mismatch";
}
@@ -91,4 +91,3 @@ _gcry_hash_selftest_check_one (int algo,
return result;
}
-