diff options
author | Niels Möller <nisse@lysator.liu.se> | 2018-10-10 19:44:32 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2018-10-10 19:44:32 +0200 |
commit | 45b5f8f3be9853b6db8def2da7f7ef333d6c8698 (patch) | |
tree | d1adc59ad55c908b8b8b27738db13443a1d42327 | |
parent | caee7cedd3314c49396e5f69eb5614067e016ca4 (diff) | |
download | nettle-struct-layout.tar.gz |
Move block buffer last in hash context structs.struct-layout
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gosthash94.h | 2 | ||||
-rw-r--r-- | md2.h | 2 | ||||
-rw-r--r-- | md4.h | 2 | ||||
-rw-r--r-- | md5.h | 2 | ||||
-rw-r--r-- | ripemd160.h | 2 | ||||
-rw-r--r-- | sha1.h | 2 | ||||
-rw-r--r-- | sha2.h | 4 |
8 files changed, 19 insertions, 8 deletions
@@ -1,3 +1,14 @@ +2018-10-10 Niels Möller <nisse@lysator.liu.se> + + * gosthash94.h (struct gosthash94_ctx): Move block buffer last in + struct. + * md2.h (struct md2_ctx): Likewise. + * md4.h (struct md4_ctx): Likewise. + * md5.h (struct md5_ctx): Likewise. + * ripemd160.h (struct ripemd160_ctx): Likewise. + * sha1.h (struct sha1_ctx): Likewise. + * sha2.h (struct sha256_ctx, struct sha512_ctx): Likewise. + 2018-10-10 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> * ctr16.c (_ctr_crypt16): Bugfix for the src == dst case, when diff --git a/gosthash94.h b/gosthash94.h index 8e9d49fe..60b2bef2 100644 --- a/gosthash94.h +++ b/gosthash94.h @@ -81,8 +81,8 @@ struct gosthash94_ctx { uint32_t hash[8]; /* algorithm 256-bit state */ uint32_t sum[8]; /* sum of processed message blocks */ - uint8_t message[GOSTHASH94_BLOCK_SIZE]; /* 256-bit buffer for leftovers */ uint64_t length; /* number of processed bytes */ + uint8_t message[GOSTHASH94_BLOCK_SIZE]; /* 256-bit buffer for leftovers */ }; void gosthash94_init(struct gosthash94_ctx *ctx); @@ -54,8 +54,8 @@ struct md2_ctx { uint8_t C[MD2_BLOCK_SIZE]; uint8_t X[3 * MD2_BLOCK_SIZE]; - uint8_t block[MD2_BLOCK_SIZE]; /* Block buffer */ unsigned index; /* Into buffer */ + uint8_t block[MD2_BLOCK_SIZE]; /* Block buffer */ }; void @@ -58,8 +58,8 @@ struct md4_ctx { uint32_t state[_MD4_DIGEST_LENGTH]; uint64_t count; /* Block count */ - uint8_t block[MD4_BLOCK_SIZE]; /* Block buffer */ unsigned index; /* Into buffer */ + uint8_t block[MD4_BLOCK_SIZE]; /* Block buffer */ }; void @@ -57,8 +57,8 @@ struct md5_ctx { uint32_t state[_MD5_DIGEST_LENGTH]; uint64_t count; /* Block count */ - uint8_t block[MD5_BLOCK_SIZE]; /* Block buffer */ unsigned index; /* Into buffer */ + uint8_t block[MD5_BLOCK_SIZE]; /* Block buffer */ }; void diff --git a/ripemd160.h b/ripemd160.h index 4fee0c60..238c5ee7 100644 --- a/ripemd160.h +++ b/ripemd160.h @@ -59,8 +59,8 @@ struct ripemd160_ctx { uint32_t state[_RIPEMD160_DIGEST_LENGTH]; uint64_t count; /* 64-bit block count */ - uint8_t block[RIPEMD160_BLOCK_SIZE]; unsigned int index; + uint8_t block[RIPEMD160_BLOCK_SIZE]; }; void @@ -59,8 +59,8 @@ struct sha1_ctx { uint32_t state[_SHA1_DIGEST_LENGTH]; /* State variables */ uint64_t count; /* 64-bit block count */ - uint8_t block[SHA1_BLOCK_SIZE]; /* SHA1 data buffer */ unsigned int index; /* index into buffer */ + uint8_t block[SHA1_BLOCK_SIZE]; /* SHA1 data buffer */ }; void @@ -74,8 +74,8 @@ struct sha256_ctx { uint32_t state[_SHA256_DIGEST_LENGTH]; /* State variables */ uint64_t count; /* 64-bit block count */ - uint8_t block[SHA256_BLOCK_SIZE]; /* SHA256 data buffer */ unsigned int index; /* index into buffer */ + uint8_t block[SHA256_BLOCK_SIZE]; /* SHA256 data buffer */ }; void @@ -121,8 +121,8 @@ struct sha512_ctx { uint64_t state[_SHA512_DIGEST_LENGTH]; /* State variables */ uint64_t count_low, count_high; /* 128-bit block count */ - uint8_t block[SHA512_BLOCK_SIZE]; /* SHA512 data buffer */ unsigned int index; /* index into buffer */ + uint8_t block[SHA512_BLOCK_SIZE]; /* SHA512 data buffer */ }; void |