X-Git-Url: https://git.cryptolib.org/?p=avr-crypto-lib.git;a=blobdiff_plain;f=sha256-asm.S;h=67956045fa00c96c97b5a82a959da5f38a7c2a2e;hp=403506ef5f4ab29150315c7837a7ee469ae88873;hb=5ac75cfae217122b540c1a6d258054230dc534c3;hpb=7c4486d3328c45462fd276916cb94b80b48725fc diff --git a/sha256-asm.S b/sha256-asm.S index 403506e..6795604 100644 --- a/sha256-asm.S +++ b/sha256-asm.S @@ -919,24 +919,18 @@ sha256_kv: ; round-key-vector stored in ProgMem ; state->length=0; ; memcpy(state->h, sha256_init_vector, 8*4); ;} -; param1: (Func3,r24) 16-bit pointer to sha256_ctx_t struct in ram +; param1: (r23,r24) 16-bit pointer to sha256_ctx_t struct in ram ; modifys: Z(r30,r31), Func1, r22 sha256_init: movw r26, r24 ; (24,25) --> (26,27) load X with param1 ldi r30, lo8((sha256_init_vector)) ldi r31, hi8((sha256_init_vector)) - ldi r22, 32 + ldi r22, 32+8 sha256_init_vloop: lpm r23, Z+ st X+, r23 dec r22 brne sha256_init_vloop - ldi r22, 8 - clr r1 ;this should not be needed -sha256_init_lloop: - st X+, r1 - dec r22 - brne sha256_init_lloop ret sha256_init_vector: @@ -948,6 +942,8 @@ sha256_init_vector: .word 0x688C, 0x9B05 .word 0xD9AB, 0x1F83 .word 0xCD19, 0x5BE0 +.word 0x0000, 0x0000 +.word 0x0000, 0x0000 ;########################################################### @@ -968,7 +964,7 @@ rotl32: mov r23, r22 mov r22, r21 subi r20, 8 - rjmp rotr32 + rjmp rotl32 bitrotl: clr r21 clc