X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Futil%2Fcrypto_hash.c;h=0370d74fbe0b6cf87e2648584907520ca5ccf411;hb=7a476fa676b8aed1bcae2b261d1eecff644ca627;hp=a8843b5b753674a3d11ce9cc9813a4141571064b;hpb=57df0fbf8398720fbd4a9cf34934c212ea00ee54;p=oweals%2Fgnunet.git diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index a8843b5b7..0370d74fb 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c @@ -214,10 +214,6 @@ sha512_transform (unsigned long long *state, const unsigned char *input) state[5] += f; state[6] += g; state[7] += h; - - /* erase our data */ - a = b = c = d = e = f = g = h = t1 = t2 = 0; - memset (W, 0, 80 * sizeof (unsigned long long)); } static void @@ -281,13 +277,13 @@ sha512_final (struct sha512_ctx *sctx, unsigned char *hash) static unsigned char padding[128] = { 0x80, }; unsigned int t; - unsigned long long t2; unsigned char bits[128]; - unsigned int index, pad_len; + unsigned int index; + unsigned int pad_len; + unsigned long long t2; int i, j; - index = pad_len = t = i = j = 0; - t2 = 0; + i = j = 0; /* Save number of bits */ t = sctx->count[0]; @@ -356,6 +352,7 @@ sha512_final (struct sha512_ctx *sctx, unsigned char *hash) memset (sctx, 0, sizeof (struct sha512_ctx)); } + /** * Hash block of given size. * @@ -368,7 +365,7 @@ GNUNET_CRYPTO_hash (const void *block, unsigned int size, GNUNET_HashCode * ret) { struct sha512_ctx ctx; - + sha512_init (&ctx); sha512_update (&ctx, block, size); sha512_final (&ctx, (unsigned char *) ret); @@ -414,13 +411,13 @@ struct FileHashContext /** * Size of the file. */ - unsigned long long fsize; + uint64_t fsize; /** * Current offset. */ - unsigned long long offset; - + uint64_t offset; + /** * Run on shutdown? */