X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=sha256-asm.S;h=a9f7c431956721fbbcc783d894dad516ebcc2f76;hb=17332291e15183d71d88ed868275e3cb53917180;hp=403506ef5f4ab29150315c7837a7ee469ae88873;hpb=6bca96e560e6097aa5b225fad67f2e2a27f4182f;p=avr-crypto-lib.git diff --git a/sha256-asm.S b/sha256-asm.S index 403506e..a9f7c43 100644 --- a/sha256-asm.S +++ b/sha256-asm.S @@ -1,6 +1,6 @@ /* sha256-asm.S */ /* - This file is part of the Crypto-avr-lib/microcrypt-lib. + This file is part of the This file is part of the AVR-Crypto-Lib. Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de) This program is free software: you can redistribute it and/or modify @@ -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