OpenSSL 1.1.1-pre2
This commit is contained in:
@@ -52,7 +52,7 @@ $OPENSSL=1;
|
||||
$output = pop;
|
||||
open STDOUT,">$output";
|
||||
|
||||
&asm_init($ARGV[0],"cmll-586.pl",$ARGV[$#ARGV] eq "386");
|
||||
&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386");
|
||||
|
||||
@T=("eax","ebx","ecx","edx");
|
||||
$idx="esi";
|
||||
@@ -792,9 +792,9 @@ if ($OPENSSL) {
|
||||
64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158);
|
||||
|
||||
sub S1110 { my $i=shift; $i=@SBOX[$i]; return $i<<24|$i<<16|$i<<8; }
|
||||
sub S4404 { my $i=shift; $i=($i<<1|$i>>7)&0xff; $i=@SBOX[$i]; return $i<<24|$i<<16|$i; }
|
||||
sub S0222 { my $i=shift; $i=@SBOX[$i]; $i=($i<<1|$i>>7)&0xff; return $i<<16|$i<<8|$i; }
|
||||
sub S3033 { my $i=shift; $i=@SBOX[$i]; $i=($i>>1|$i<<7)&0xff; return $i<<24|$i<<8|$i; }
|
||||
sub S4404 { my $i=shift; $i=($i<<1|$i>>7)&0xff; $i=@SBOX[$i]; return $i<<24|$i<<16|$i; }
|
||||
sub S0222 { my $i=shift; $i=@SBOX[$i]; $i=($i<<1|$i>>7)&0xff; return $i<<16|$i<<8|$i; }
|
||||
sub S3033 { my $i=shift; $i=@SBOX[$i]; $i=($i>>1|$i<<7)&0xff; return $i<<24|$i<<8|$i; }
|
||||
|
||||
&set_label("Camellia_SIGMA",64);
|
||||
&data_word(
|
||||
|
||||
@@ -137,11 +137,17 @@ Camellia_EncryptBlock:
|
||||
.align 16
|
||||
.Lenc_rounds:
|
||||
Camellia_EncryptBlock_Rounds:
|
||||
.cfi_startproc
|
||||
push %rbx
|
||||
.cfi_push %rbx
|
||||
push %rbp
|
||||
.cfi_push %rbp
|
||||
push %r13
|
||||
.cfi_push %r13
|
||||
push %r14
|
||||
.cfi_push %r14
|
||||
push %r15
|
||||
.cfi_push %r15
|
||||
.Lenc_prologue:
|
||||
|
||||
#mov %rsi,$inp # put away arguments
|
||||
@@ -173,13 +179,20 @@ Camellia_EncryptBlock_Rounds:
|
||||
mov @S[3],12($out)
|
||||
|
||||
mov 0(%rsp),%r15
|
||||
.cfi_restore %r15
|
||||
mov 8(%rsp),%r14
|
||||
.cfi_restore %r14
|
||||
mov 16(%rsp),%r13
|
||||
.cfi_restore %r13
|
||||
mov 24(%rsp),%rbp
|
||||
.cfi_restore %rbp
|
||||
mov 32(%rsp),%rbx
|
||||
.cfi_restore %rbx
|
||||
lea 40(%rsp),%rsp
|
||||
.cfi_adjust_cfa_offset -40
|
||||
.Lenc_epilogue:
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size Camellia_EncryptBlock_Rounds,.-Camellia_EncryptBlock_Rounds
|
||||
|
||||
.type _x86_64_Camellia_encrypt,\@abi-omnipotent
|
||||
@@ -247,11 +260,17 @@ Camellia_DecryptBlock:
|
||||
.align 16
|
||||
.Ldec_rounds:
|
||||
Camellia_DecryptBlock_Rounds:
|
||||
.cfi_startproc
|
||||
push %rbx
|
||||
.cfi_push %rbx
|
||||
push %rbp
|
||||
.cfi_push %rbp
|
||||
push %r13
|
||||
.cfi_push %r13
|
||||
push %r14
|
||||
.cfi_push %r14
|
||||
push %r15
|
||||
.cfi_push %r15
|
||||
.Ldec_prologue:
|
||||
|
||||
#mov %rsi,$inp # put away arguments
|
||||
@@ -283,13 +302,20 @@ Camellia_DecryptBlock_Rounds:
|
||||
mov @S[3],12($out)
|
||||
|
||||
mov 0(%rsp),%r15
|
||||
.cfi_restore %r15
|
||||
mov 8(%rsp),%r14
|
||||
.cfi_restore %r14
|
||||
mov 16(%rsp),%r13
|
||||
.cfi_restore %r13
|
||||
mov 24(%rsp),%rbp
|
||||
.cfi_restore %rbp
|
||||
mov 32(%rsp),%rbx
|
||||
.cfi_restore %rbx
|
||||
lea 40(%rsp),%rsp
|
||||
.cfi_adjust_cfa_offset -40
|
||||
.Ldec_epilogue:
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size Camellia_DecryptBlock_Rounds,.-Camellia_DecryptBlock_Rounds
|
||||
|
||||
.type _x86_64_Camellia_decrypt,\@abi-omnipotent
|
||||
@@ -409,11 +435,17 @@ $code.=<<___;
|
||||
.type Camellia_Ekeygen,\@function,3
|
||||
.align 16
|
||||
Camellia_Ekeygen:
|
||||
.cfi_startproc
|
||||
push %rbx
|
||||
.cfi_push %rbx
|
||||
push %rbp
|
||||
.cfi_push %rbp
|
||||
push %r13
|
||||
.cfi_push %r13
|
||||
push %r14
|
||||
.cfi_push %r14
|
||||
push %r15
|
||||
.cfi_push %r15
|
||||
.Lkey_prologue:
|
||||
|
||||
mov %edi,${keyend}d # put away arguments, keyBitLength
|
||||
@@ -573,13 +605,20 @@ $code.=<<___;
|
||||
mov \$4,%eax
|
||||
.Ldone:
|
||||
mov 0(%rsp),%r15
|
||||
.cfi_restore %r15
|
||||
mov 8(%rsp),%r14
|
||||
.cfi_restore %r14
|
||||
mov 16(%rsp),%r13
|
||||
.cfi_restore %r13
|
||||
mov 24(%rsp),%rbp
|
||||
.cfi_restore %rbp
|
||||
mov 32(%rsp),%rbx
|
||||
.cfi_restore %rbx
|
||||
lea 40(%rsp),%rsp
|
||||
.cfi_adjust_cfa_offset -40
|
||||
.Lkey_epilogue:
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size Camellia_Ekeygen,.-Camellia_Ekeygen
|
||||
___
|
||||
}
|
||||
@@ -637,17 +676,25 @@ $code.=<<___;
|
||||
.type Camellia_cbc_encrypt,\@function,6
|
||||
.align 16
|
||||
Camellia_cbc_encrypt:
|
||||
.cfi_startproc
|
||||
cmp \$0,%rdx
|
||||
je .Lcbc_abort
|
||||
push %rbx
|
||||
.cfi_push %rbx
|
||||
push %rbp
|
||||
.cfi_push %rbp
|
||||
push %r12
|
||||
.cfi_push %r12
|
||||
push %r13
|
||||
.cfi_push %r13
|
||||
push %r14
|
||||
.cfi_push %r14
|
||||
push %r15
|
||||
.cfi_push %r15
|
||||
.Lcbc_prologue:
|
||||
|
||||
mov %rsp,%rbp
|
||||
.cfi_def_cfa_register %rbp
|
||||
sub \$64,%rsp
|
||||
and \$-64,%rsp
|
||||
|
||||
@@ -668,6 +715,7 @@ Camellia_cbc_encrypt:
|
||||
|
||||
mov %r8,$_ivp
|
||||
mov %rbp,$_rsp
|
||||
.cfi_cfa_expression $_rsp,deref,+56
|
||||
|
||||
.Lcbc_body:
|
||||
lea .LCamellia_SBOX(%rip),$Tbl
|
||||
@@ -856,15 +904,24 @@ Camellia_cbc_encrypt:
|
||||
.align 16
|
||||
.Lcbc_done:
|
||||
mov $_rsp,%rcx
|
||||
.cfi_def_cfa %rcx,56
|
||||
mov 0(%rcx),%r15
|
||||
.cfi_restore %r15
|
||||
mov 8(%rcx),%r14
|
||||
.cfi_restore %r14
|
||||
mov 16(%rcx),%r13
|
||||
.cfi_restore %r13
|
||||
mov 24(%rcx),%r12
|
||||
.cfi_restore %r12
|
||||
mov 32(%rcx),%rbp
|
||||
.cfi_restore %rbp
|
||||
mov 40(%rcx),%rbx
|
||||
.cfi_restore %rbx
|
||||
lea 48(%rcx),%rsp
|
||||
.cfi_def_cfa %rsp,8
|
||||
.Lcbc_abort:
|
||||
ret
|
||||
.cfi_endproc
|
||||
.size Camellia_cbc_encrypt,.-Camellia_cbc_encrypt
|
||||
|
||||
.asciz "Camellia for x86_64 by <appro\@openssl.org>"
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
|
||||
# ====================================================================
|
||||
# Written by David S. Miller <davem@devemloft.net> and Andy Polyakov
|
||||
# <appro@openssl.org>. The module is licensed under 2-clause BSD
|
||||
# Written by David S. Miller and Andy Polyakov.
|
||||
# The module is licensed under 2-clause BSD
|
||||
# license. October 2012. All rights reserved.
|
||||
# ====================================================================
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# Camellia for SPARC T4.
|
||||
#
|
||||
# As with AES below results [for aligned data] are virtually identical
|
||||
# to critical path lenths for 3-cycle instruction latency:
|
||||
# to critical path lengths for 3-cycle instruction latency:
|
||||
#
|
||||
# 128-bit key 192/256-
|
||||
# CBC encrypt 4.14/4.21(*) 5.46/5.52
|
||||
@@ -25,7 +25,7 @@
|
||||
# misaligned data.
|
||||
#
|
||||
# As with Intel AES-NI, question is if it's possible to improve
|
||||
# performance of parallelizeable modes by interleaving round
|
||||
# performance of parallelizable modes by interleaving round
|
||||
# instructions. In Camellia every instruction is dependent on
|
||||
# previous, which means that there is place for 2 additional ones
|
||||
# in between two dependent. Can we expect 3x performance improvement?
|
||||
|
||||
@@ -3,7 +3,9 @@ SOURCE[../../libcrypto]=\
|
||||
cmll_ecb.c cmll_ofb.c cmll_cfb.c cmll_ctr.c \
|
||||
{- $target{cmll_asm_src} -}
|
||||
|
||||
GENERATE[cmll-x86.s]=asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(LIB_CFLAGS) $(PROCESSOR)
|
||||
GENERATE[cmll-x86.s]=asm/cmll-x86.pl \
|
||||
$(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) \
|
||||
$(PROCESSOR)
|
||||
DEPEND[cmll-x86.s]=../perlasm/x86asm.pl
|
||||
GENERATE[cmll-x86_64.s]=asm/cmll-x86_64.pl $(PERLASM_SCHEME)
|
||||
GENERATE[cmllt4-sparcv9.S]=asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME)
|
||||
|
||||
Reference in New Issue
Block a user