From 2ab46954cb6318f20cb24773e214ac9426f85345 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sat, 21 May 2016 10:17:06 +0300 Subject: [PATCH 1/2] Fix state size in sha256 struct --- src/hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hash.h b/src/hash.h index 0ff01e63..fca98cab 100644 --- a/src/hash.h +++ b/src/hash.h @@ -11,7 +11,7 @@ #include typedef struct { - uint32_t s[32]; + uint32_t s[8]; uint32_t buf[16]; /* In big endian */ size_t bytes; } secp256k1_sha256_t; From 3f8b78e5e9e1b0c2e1214ba8de9b164d24aabdd5 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Sat, 21 May 2016 10:18:57 +0300 Subject: [PATCH 2/2] Fix undefs in hash_impl.h --- src/hash_impl.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hash_impl.h b/src/hash_impl.h index ae55df6d..b47e65f8 100644 --- a/src/hash_impl.h +++ b/src/hash_impl.h @@ -269,15 +269,13 @@ static void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256 rng->retry = 0; } - +#undef BE32 #undef Round -#undef sigma0 #undef sigma1 -#undef Sigma0 +#undef sigma0 #undef Sigma1 -#undef Ch +#undef Sigma0 #undef Maj -#undef ReadBE32 -#undef WriteBE32 +#undef Ch #endif