diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:46:35 +0000 |
commit | 502af2167f7c218366666ca4944bd7cc54b5b19a (patch) | |
tree | a91fec5cc9769d260640bd91c6633cb9cf395524 /src/util/crypto_crc.c | |
parent | 03af5a603b7cc53432249d5854cd412aa90dde0d (diff) | |
download | gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip |
indentation
Diffstat (limited to 'src/util/crypto_crc.c')
-rw-r--r-- | src/util/crypto_crc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/util/crypto_crc.c b/src/util/crypto_crc.c index 8f5cfc800..543bc4c65 100644 --- a/src/util/crypto_crc.c +++ b/src/util/crypto_crc.c | |||
@@ -52,7 +52,7 @@ static uLong crc_table[256]; | |||
52 | * with the ccorrect final value. Thus, it is safe to call | 52 | * with the ccorrect final value. Thus, it is safe to call |
53 | * even on a table that someone else is using concurrently. | 53 | * even on a table that someone else is using concurrently. |
54 | */ | 54 | */ |
55 | static void | 55 | static void |
56 | crc_init () | 56 | crc_init () |
57 | { | 57 | { |
58 | static int once; | 58 | static int once; |
@@ -64,12 +64,12 @@ crc_init () | |||
64 | once = 1; | 64 | once = 1; |
65 | crc_table[0] = 0; | 65 | crc_table[0] = 0; |
66 | for (i = 128; i; i >>= 1) | 66 | for (i = 128; i; i >>= 1) |
67 | { | 67 | { |
68 | h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0); | 68 | h = (h >> 1) ^ ((h & 1) ? POLYNOMIAL : 0); |
69 | /* h is now crc_table[i] */ | 69 | /* h is now crc_table[i] */ |
70 | for (j = 0; j < 256; j += 2 * i) | 70 | for (j = 0; j < 256; j += 2 * i) |
71 | crc_table[i + j] = crc_table[j] ^ h; | 71 | crc_table[i + j] = crc_table[j] ^ h; |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | /* | 75 | /* |
@@ -105,6 +105,7 @@ int32_t | |||
105 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len) | 105 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len) |
106 | { | 106 | { |
107 | uLong crc; | 107 | uLong crc; |
108 | |||
108 | crc = crc32 (0L, Z_NULL, 0); | 109 | crc = crc32 (0L, Z_NULL, 0); |
109 | crc = crc32 (crc, (char *) buf, len); | 110 | crc = crc32 (crc, (char *) buf, len); |
110 | return crc; | 111 | return crc; |