]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* x86/arcfour-crypt.asm: Use ARCFOUR_I and ARCFOUR_J
authorNiels Möller <nisse@lysator.liu.se>
Mon, 17 Oct 2005 18:33:58 +0000 (20:33 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 17 Oct 2005 18:33:58 +0000 (20:33 +0200)
* asm.m4 (ARCFOUR): New struct.

Rev: src/nettle/asm.m4:1.15
Rev: src/nettle/x86/arcfour-crypt.asm:1.14

asm.m4
x86/arcfour-crypt.asm

diff --git a/asm.m4 b/asm.m4
index ee2be4fc4bc79e8382505fabee7a5ef189bd3fa4..99c72c01fc2604f63fcbae3aec87da2621ea68b9 100644 (file)
--- a/asm.m4
+++ b/asm.m4
@@ -34,9 +34,18 @@ define(<STRUCT>,
 <define(SPREFIX<_>$1, SOFFSET)dnl
  define(<SOFFSET>, eval(SOFFSET + ($2)))>)dnl
 
+dnl UCHAR(name)
+define(<UCHAR>, <STRUCT(<$1>, 1)>)dnl
+
 dnl UNSIGNED(name)
 define(<UNSIGNED>, <STRUCT(<$1>, 4)>)dnl
 
+dnl Offsets in arcfour_ctx
+STRUCTURE(ARCFOUR)
+  STRUCT(S, 256)
+  UCHAR(I)
+  UCHAR(J)
+
 dnl Offsets in aes_ctx and aes_table
 STRUCTURE(AES)
   STRUCT(KEYS, 4*60)
index 74a65a9474d0984978207bacce0252a2a0e6407e..5c87ff8c2007f8c3a1c46f7def794c769e2004b5 100644 (file)
@@ -55,8 +55,8 @@ C Register usage:
        movl    32(%esp), %esi
        addl    %esi, %edx              C  Keep src + length
        
-       movzbl  256(%ebp), %eax         C  i
-       movzbl  257(%ebp), %ebx         C  j
+       movzbl  ARCFOUR_I (%ebp), %eax  C  i
+       movzbl  ARCFOUR_J (%ebp), %ebx  C  j
 .Lloop:
 C      incb    %al
        incl    %eax
@@ -80,8 +80,8 @@ C     andl    $0xff, %ebx
        cmpl    %esi, %edx
        jne     .Lloop
 
-       movb    %al, 256(%ebp)          C  Store the new i and j.
-       movb    %bl, 257(%ebp)
+       movb    %al, ARCFOUR_I (%ebp)           C  Store the new i and j.
+       movb    %bl, ARCFOUR_J (%ebp)
 .Lend:
        popl    %edi
        popl    %esi