]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - sha256-asm.S
insereated GPLv3 stub
[avr-crypto-lib.git] / sha256-asm.S
index 0769e7cd28e5a8e41d2c0f6356ed6c1c1cc2f0be..392bf421efe911ea770e57d6d1ce64c04eb8027e 100644 (file)
@@ -1,3 +1,21 @@
+/* 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
@@ -96,8 +114,8 @@ SREG = 0x3F
 ;###########################################################   \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
@@ -840,13 +858,13 @@ update_state_loop:
        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