poly1305/asm/poly1305-x86_64.pl: make it work with linux-x32.
authorAndy Polyakov <appro@openssl.org>
Tue, 15 Mar 2016 22:39:07 +0000 (23:39 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 15 Mar 2016 22:58:31 +0000 (23:58 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Configurations/10-main.conf
crypto/poly1305/asm/poly1305-x86_64.pl

index 53ba0409db1fc2c9fce7416760a84e2b08aa274c..f9c838c2599244fe2ec221de9847fae5d71cc73c 100644 (file)
@@ -745,7 +745,7 @@ sub vc_wince_info {
         inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
         cflags           => add("-mx32 -DL_ENDIAN"),
         bn_ops           => "SIXTY_FOUR_BIT",
         inherit_from     => [ "linux-generic32", asm("x86_64_asm") ],
         cflags           => add("-mx32 -DL_ENDIAN"),
         bn_ops           => "SIXTY_FOUR_BIT",
-        perlasm_scheme   => "elf",
+        perlasm_scheme   => "elf32",
         shared_ldflag    => "-mx32",
         multilib         => "x32",
     },
         shared_ldflag    => "-mx32",
         multilib         => "x32",
     },
index 22656641804e2281605ba502a57b9991c5d8104a..8977d563a25166b5c3bfac9bb952703c40962cfd 100755 (executable)
@@ -165,10 +165,16 @@ $code.=<<___;
        and     8($inp),%rcx
        mov     %rax,24($ctx)
        mov     %rcx,32($ctx)
        and     8($inp),%rcx
        mov     %rax,24($ctx)
        mov     %rcx,32($ctx)
-
+___
+$code.=<<___   if ($flavour !~ /elf32/);
        mov     %r10,0(%rdx)
        mov     %r11,8(%rdx)
        mov     %r10,0(%rdx)
        mov     %r11,8(%rdx)
-
+___
+$code.=<<___   if ($flavour =~ /elf32/);
+       mov     %r10d,0(%rdx)
+       mov     %r11d,4(%rdx)
+___
+$code.=<<___;
        mov     \$1,%eax
 .Lno_key:
        ret
        mov     \$1,%eax
 .Lno_key:
        ret