]> git.cryptolib.org Git - avr-crypto-lib.git/blobdiff - noekeon_asm.S
insereated GPLv3 stub
[avr-crypto-lib.git] / noekeon_asm.S
index d880296389fdc63cdf2dd2adef5d57b77eba3792..8ebcc93c6578ce3b13698cf4e9bff2cf084c7278 100644 (file)
@@ -1,3 +1,21 @@
+/* noekeon_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/>.
+*/
 /* 
  * noekeon assembler implementation for avr
  * author: Daniel Otte
        push r17
        push r28
        push r29
-       in r28, _SFR_IO_ADDR(SREG)
-       push r28
 .endm
 
 .macro pop_all
-       pop r28
-       out _SFR_IO_ADDR(SREG), r28
        pop r29
        pop r28
        pop r17
@@ -451,8 +465,8 @@ round:
        push r25
        push r24
 pi_gamma_pi:
-       ldi r30, lo8(bigendian_rotl32)
-       ldi r31, hi8(bigendian_rotl32)
+       ldi r30, pm_lo8(bigendian_rotl32)
+       ldi r31, pm_hi8(bigendian_rotl32)
        call pi
        /* pi1 done; now gamma */
        call gamma_1
@@ -465,23 +479,10 @@ pi_gamma_pi:
        op32 eor, state2, state0
        op32 eor, state2, state1
        op32 eor, state2, state3
-/*     
-       eor state2_0, state0_0
-       eor state2_1, state0_1
-       eor state2_2, state0_2
-       eor state2_3, state0_3
-       eor state2_0, state1_0
-       eor state2_1, state1_1
-       eor state2_2, state1_2
-       eor state2_3, state1_3
-       eor state2_0, state3_0
-       eor state2_1, state3_1
-       eor state2_2, state3_2
-       eor state2_3, state3_3
-*/
+
        call gamma_1
-       ldi r30, lo8(bigendian_rotr32)
-       ldi r31, hi8(bigendian_rotr32)
+       ldi r30, pm_lo8(bigendian_rotr32)
+       ldi r31, pm_hi8(bigendian_rotr32)
        call pi
        ret
        
@@ -526,8 +527,6 @@ gamma_1:
        ret
        
 pi:    
-       lsr r31
-       ror r30
        /* a[1] <<<= 1*/
        mov r22, state1_0
        mov r23, state1_1