+/* sha256-asm.S */
+/*
+ This file is part of the Crypto-avr-lib/microcrypt-lib.
+ Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
/*\r
* Author: Daniel Otte\r
*\r
;########################################################### \r
\r
.global sha256_ctx2hash\r
-; === sha256_lastBlock ===\r
-; this function does padding & Co. for calculating SHA-256 hashes\r
+; === sha256_ctx2hash ===\r
+; this function converts a state into a normal hash (bytestring)\r
; param1: the 16-bit destination pointer\r
; given in r25,r24 (r25 is most significant)\r
; param2: the 16-bit pointer to sha256_ctx structure\r
add r20, r21\r
st Z+, r20 \r
clr r21\r
-sha256_nexBlock_fix_length: \r
+sha256_nextBlock_fix_length: \r
brcc sha256_nextBlock_epilog\r
ld r20, Z\r
adc r20, r21\r
st Z+, r20\r
dec r22\r
- brne sha256_nexBlock_fix_length\r
+ brne sha256_nextBlock_fix_length\r
\r
; EPILOG\r
sha256_nextBlock_epilog:\r