projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stuff
[oweals/gnunet.git]
/
src
/
util
/
crypto_hash.c
diff --git
a/src/util/crypto_hash.c
b/src/util/crypto_hash.c
index a8843b5b753674a3d11ce9cc9813a4141571064b..0370d74fbe0b6cf87e2648584907520ca5ccf411 100644
(file)
--- 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;
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
}
static void
@@
-281,13
+277,13
@@
sha512_final (struct sha512_ctx *sctx, unsigned char *hash)
static unsigned char padding[128] = { 0x80, };
unsigned int t;
static unsigned char padding[128] = { 0x80, };
unsigned int t;
- unsigned long long t2;
unsigned char bits[128];
unsigned char bits[128];
- unsigned int index, pad_len;
+ unsigned int index;
+ unsigned int pad_len;
+ unsigned long long t2;
int i, j;
int i, j;
- index = pad_len = t = i = j = 0;
- t2 = 0;
+ i = j = 0;
/* Save number of bits */
t = sctx->count[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));
}
memset (sctx, 0, sizeof (struct sha512_ctx));
}
+
/**
* Hash block of given size.
*
/**
* 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;
GNUNET_HashCode * ret)
{
struct sha512_ctx ctx;
-
+
sha512_init (&ctx);
sha512_update (&ctx, block, size);
sha512_final (&ctx, (unsigned char *) ret);
sha512_init (&ctx);
sha512_update (&ctx, block, size);
sha512_final (&ctx, (unsigned char *) ret);
@@
-414,13
+411,13
@@
struct FileHashContext
/**
* Size of the file.
*/
/**
* Size of the file.
*/
- u
nsigned long long
fsize;
+ u
int64_t
fsize;
/**
* Current offset.
*/
/**
* Current offset.
*/
- u
nsigned long long
offset;
-
+ u
int64_t
offset;
+
/**
* Run on shutdown?
*/
/**
* Run on shutdown?
*/