mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
sha/asm/keccak1600-armv8.pl: halve the size of hw-assisted subroutine.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
46cc9f35ae
commit
dd2d7b19f8
@ -538,13 +538,13 @@ $code.=<<___;
|
||||
.type KeccakF1600_ce,%function
|
||||
.align 5
|
||||
KeccakF1600_ce:
|
||||
mov x9,#6
|
||||
mov x9,#12
|
||||
adr x10,iotas
|
||||
b .Loop_ce
|
||||
.align 4
|
||||
.Loop_ce:
|
||||
___
|
||||
for($i=0; $i<4; $i++) {
|
||||
for($i=0; $i<2; $i++) {
|
||||
$code.=<<___;
|
||||
////////////////////////////////////////////////// Theta
|
||||
eor3 $C[0],$A[0][0],$A[1][0],$A[2][0]
|
||||
@ -584,7 +584,7 @@ $code.=<<___;
|
||||
eor $A[0][0],$A[0][0],$C[4]
|
||||
ldr x11,[x10],#8
|
||||
|
||||
xar $C[1] ,$A[3][3],$C[2],#64-$rhotates[3][3] // C[1]=A[0][3]
|
||||
xar $C[1], $A[3][3],$C[2],#64-$rhotates[3][3] // C[1]=A[0][3]
|
||||
xar $A[3][3],$A[3][2],$C[6],#64-$rhotates[3][2]
|
||||
xar $A[3][2],$A[2][1],$C[5],#64-$rhotates[2][1]
|
||||
xar $A[2][1],$A[1][2],$C[6],#64-$rhotates[1][2]
|
||||
@ -598,7 +598,7 @@ $code.=<<___;
|
||||
xar $A[1][3],$A[3][1],$C[5],#64-$rhotates[3][1]
|
||||
xar $A[3][1],$A[1][0],$C[4],#64-$rhotates[1][0]
|
||||
|
||||
xar $A[1][0],$A[0][3],$C[2],#64-$rhotates[0][3] // *
|
||||
xar $C[2], $A[0][3],$C[2],#64-$rhotates[0][3] // C[2]=A[1][0]
|
||||
|
||||
////////////////////////////////////////////////// Chi+Iota
|
||||
dup $C[6],x11 // borrow C[6]
|
||||
@ -608,36 +608,36 @@ $code.=<<___;
|
||||
bcax $A[0][3],$C[1], $A[0][0],$A[0][4]
|
||||
bcax $A[0][4],$A[0][4],$C[0], $A[0][0]
|
||||
|
||||
bcax $C[0], $A[1][0],$A[1][2],$A[1][1] // *
|
||||
bcax $C[1], $A[1][1],$A[1][3],$A[1][2] // *
|
||||
bcax $A[1][0],$C[2], $A[1][2],$A[1][1] // *
|
||||
bcax $C[0], $A[1][1],$A[1][3],$A[1][2] // *
|
||||
bcax $A[1][2],$A[1][2],$A[1][4],$A[1][3]
|
||||
bcax $A[1][3],$A[1][3],$A[1][0],$A[1][4]
|
||||
bcax $A[1][4],$A[1][4],$A[1][1],$A[1][0]
|
||||
bcax $A[1][3],$A[1][3],$C[2], $A[1][4]
|
||||
bcax $A[1][4],$A[1][4],$A[1][1],$C[2]
|
||||
|
||||
eor $A[0][0],$C[3],$C[6] // Iota
|
||||
|
||||
bcax $C[2], $A[2][0],$A[2][2],$A[2][1] // *
|
||||
bcax $C[3], $A[2][1],$A[2][3],$A[2][2] // *
|
||||
bcax $C[1], $A[2][0],$A[2][2],$A[2][1] // *
|
||||
bcax $C[2], $A[2][1],$A[2][3],$A[2][2] // *
|
||||
bcax $A[2][2],$A[2][2],$A[2][4],$A[2][3]
|
||||
bcax $A[2][3],$A[2][3],$A[2][0],$A[2][4]
|
||||
bcax $A[2][4],$A[2][4],$A[2][1],$A[2][0]
|
||||
|
||||
bcax $A[2][0],$A[3][0],$A[3][2],$A[3][1] // *
|
||||
bcax $A[2][1],$A[3][1],$A[3][3],$A[3][2] // *
|
||||
bcax $C[3], $A[3][0],$A[3][2],$A[3][1] // *
|
||||
bcax $C[4], $A[3][1],$A[3][3],$A[3][2] // *
|
||||
bcax $A[3][2],$A[3][2],$A[3][4],$A[3][3]
|
||||
bcax $A[3][3],$A[3][3],$A[3][0],$A[3][4]
|
||||
bcax $A[3][4],$A[3][4],$A[3][1],$A[3][0]
|
||||
|
||||
bcax $A[3][0],$A[4][0],$A[4][2],$A[4][1] // *
|
||||
bcax $A[3][1],$A[4][1],$A[4][3],$A[4][2] // *
|
||||
bcax $C[5], $A[4][0],$A[4][2],$A[4][1] // *
|
||||
bcax $C[6], $A[4][1],$A[4][3],$A[4][2] // *
|
||||
bcax $A[4][2],$A[4][2],$A[4][4],$A[4][3]
|
||||
bcax $A[4][3],$A[4][3],$A[4][0],$A[4][4]
|
||||
bcax $A[4][4],$A[4][4],$A[4][1],$A[4][0]
|
||||
___
|
||||
($A[1][0],$A[1][1], $C[0],$C[1])
|
||||
= ($C[0],$C[1], $A[1][0],$A[1][1]);
|
||||
($A[2][0],$A[2][1], $A[3][0],$A[3][1], $A[4][0],$A[4][1], $C[2],$C[3])
|
||||
= ($C[2],$C[3], $A[2][0],$A[2][1], $A[3][0],$A[3][1], $A[4][0],$A[4][1]);
|
||||
( $A[1][1], $C[0]) = ( $C[0], $A[1][1]);
|
||||
($A[2][0],$A[2][1], $C[1],$C[2]) = ($C[1],$C[2], $A[2][0],$A[2][1]);
|
||||
($A[3][0],$A[3][1], $C[3],$C[4]) = ($C[3],$C[4], $A[3][0],$A[3][1]);
|
||||
($A[4][0],$A[4][1], $C[5],$C[6]) = ($C[5],$C[6], $A[4][0],$A[4][1]);
|
||||
}
|
||||
$code.=<<___;
|
||||
subs x9,x9,#1
|
||||
|
Loading…
Reference in New Issue
Block a user