]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - sha256-asm.S
forgotten files
[avr-crypto-lib.git] / sha256-asm.S
index 67956045fa00c96c97b5a82a959da5f38a7c2a2e..d9eb6b65a789a49a7dc730775685114f146ed53b 100644 (file)
@@ -1,6 +1,6 @@
 /* sha256-asm.S */
 /*
-    This file is part of the Crypto-avr-lib/microcrypt-lib.
+    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
@@ -253,21 +253,24 @@ sha256_lastBlock_localSpace = (SHA256_BLOCK_BITS/8+1)
 
 
 sha256_lastBlock:
-       tst r20
-       brne sha256_lastBlock_prolog
        cpi r21, 0x02
-       brne sha256_lastBlock_prolog
+       brlo sha256_lastBlock_prolog
        push r25
        push r24
        push r23
        push r22
+       push r21
+       push r20
        rcall sha256_nextBlock
+       pop r20
+       pop r21
        pop r22
        pop r23
        pop r24
        pop r25
-       clr r21
-       clr r22
+       subi r21, 0x02
+       subi r23, -2
+       rjmp sha256_lastBlock   
 sha256_lastBlock_prolog:
        /* allocate space on stack */
        in r30, SPL