summaryrefslogtreecommitdiffstats
path: root/src/crypto/sha/sha256.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/sha/sha256.c')
-rw-r--r--src/crypto/sha/sha256.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/crypto/sha/sha256.c b/src/crypto/sha/sha256.c
index 8276bbb..8d4106e 100644
--- a/src/crypto/sha/sha256.c
+++ b/src/crypto/sha/sha256.c
@@ -144,13 +144,10 @@ int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) {
* to truncate to amount of bytes not divisible by 4. I bet not, but if it is,
* then default: case shall be extended. For reference. Idea behind separate
* cases for pre-defined lenghts is to let the compiler decide if it's
- * appropriate to unroll small loops.
- *
- * TODO(davidben): The small |md_len| case is one of the few places a low-level
- * hash 'final' function can fail. This should never happen. */
+ * appropriate to unroll small loops. */
#define HASH_MAKE_STRING(c, s) \
do { \
- uint32_t ll; \
+ unsigned long ll; \
unsigned int nn; \
switch ((c)->md_len) { \
case SHA224_DIGEST_LENGTH: \
@@ -166,9 +163,8 @@ int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) {
} \
break; \
default: \
- if ((c)->md_len > SHA256_DIGEST_LENGTH) { \
+ if ((c)->md_len > SHA256_DIGEST_LENGTH) \
return 0; \
- } \
for (nn = 0; nn < (c)->md_len / 4; nn++) { \
ll = (c)->h[nn]; \
(void) HOST_l2c(ll, (s)); \
@@ -236,7 +232,7 @@ static const HASH_LONG K256[64] = {
static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
size_t num) {
- uint32_t a, b, c, d, e, f, g, h, s0, s1, T1;
+ unsigned MD32_REG_T a, b, c, d, e, f, g, h, s0, s1, T1;
HASH_LONG X[16];
int i;
const uint8_t *data = in;