Fixed an sha bug

This commit is contained in:
bzt 2021-01-11 16:47:41 +01:00
parent 37fe9adfee
commit 7f1a28dd2d
3 changed files with 8 additions and 10 deletions

BIN
dist/bootboot.bin vendored

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -2411,25 +2411,23 @@ sha_final: push esi
add edi, sha_d
mov al, 80h
stosb
inc ecx
xor eax, eax
; if(ctx->l<56) {while(i<56) ctx->d[i++]=0x00;}
cmp cl, 56
cmp cl, 57
jae @f
neg ecx
add ecx, 63
xor al, al
add ecx, 56
repnz stosb
jmp .padded
@@: ; else {while(i<64) ctx->d[i++]=0x00;sha256_t(ctx);memset(ctx->d,0,56);}
stosb
neg ecx
add ecx, 64
repnz stosb
call .sha_t
push ecx
mov ecx, 56/4
mov edi, sha_d
repnz stosd
pop ecx
inc cl
cmp cl, 64
jne @b
.padded: ; SHA_ADD(ctx->b[0],ctx->b[1],ctx->l*8);
mov eax, dword [sha_l]
shl eax, 3