Skip to content

Commit cfbd7f8

Browse files
authored
Merge pull request #545 from libtom/pattop/fixes
Minor fix & cleanup
2 parents 3f1b687 + d63d6fa commit cfbd7f8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/hashes/sha2/sha256.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,8 @@ static int s_sha256_compress(hash_state * md, const unsigned char *buf)
168168
RND(S[3],S[4],S[5],S[6],S[7],S[0],S[1],S[2],61,0xa4506ceb);
169169
RND(S[2],S[3],S[4],S[5],S[6],S[7],S[0],S[1],62,0xbef9a3f7);
170170
RND(S[1],S[2],S[3],S[4],S[5],S[6],S[7],S[0],63,0xc67178f2);
171-
172-
#undef RND
173-
174171
#endif
172+
#undef RND
175173

176174
/* feedback */
177175
for (i = 0; i < 8; i++) {

src/headers/tomcrypt_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int func_name (hash_state * md, const unsigned char *in, unsigned long inlen)
9090
if (md-> state_var .curlen > sizeof(md-> state_var .buf)) { \
9191
return CRYPT_INVALID_ARG; \
9292
} \
93-
if ((md-> state_var .length + inlen) < md-> state_var .length) { \
93+
if ((md-> state_var .length + inlen * 8) < md-> state_var .length) { \
9494
return CRYPT_HASH_OVERFLOW; \
9595
} \
9696
while (inlen > 0) { \

0 commit comments

Comments
 (0)