Improve firmware parser and tool robustness

closes #241
This commit is contained in:
joevt 2021-10-07 18:51:39 +03:00 committed by vit9696
parent e14547c497
commit f9c35f77a6
41 changed files with 415 additions and 324 deletions

View file

@ -108,10 +108,10 @@ static void sha256_compress(struct sha256_state *md, unsigned char *buf)
W[i - 16];
}
/* Compress */
#define RND(a,b,c,d,e,f,g,h,i) \
t0 = (uint32_t)(h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]); \
t1 = (uint32_t)(Sigma0(a) + Maj(a, b, c)); \
d += t0; \
#define RND(a,b,c,d,e,f,g,h,i) \
t0 = (uint32_t)(h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]); \
t1 = (uint32_t)(Sigma0(a) + Maj(a, b, c)); \
d += t0; \
h = t0 + t1;
for (i = 0; i < 64; ++i) {
RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], i);