Skip to content

Commit

Permalink
added gen-src files for keccak arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemas committed Sep 10, 2024
1 parent 379ff03 commit a8c5c5d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
22 changes: 13 additions & 9 deletions generated-src/ios-aarch64/crypto/fipsmodule/keccak1600-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -489,23 +489,27 @@ _SHA3_Squeeze_hw:
mov x20,x1
mov x21,x2
mov x22,x3
Loop_squeeze:
cmp x4, #0
bne Lfirst_squeeze // if (first != 0) -> first block -> skip first Keccak
Loop_squeeze: // Squeeze loop (Keccak & Store)
mov x0,x19
bl KeccakF1600
Lfirst_squeeze:
mov x0,x19
mov x3,x22
L_squeeze: // Store loop
ldr x4,[x0],#8
cmp x21,#8
blo Lsqueeze_tail
blo Lsqueeze_tail // Store tail only
#ifdef __AARCH64EB__
rev x4,x4
#endif
str x4,[x20],#8
subs x21,x21,#8
beq Lsqueeze_done
ble Lsqueeze_done
subs x3,x3,#8
bhi Loop_squeeze
mov x0,x19
bl KeccakF1600
mov x0,x19
mov x3,x22
b Loop_squeeze
bhi L_squeeze // End store loop
b Loop_squeeze // End Squeeze loop (Keccak & Store)
.align 4
Lsqueeze_tail:
strb w4,[x20],#1
Expand Down
22 changes: 13 additions & 9 deletions generated-src/linux-aarch64/crypto/fipsmodule/keccak1600-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -489,23 +489,27 @@ SHA3_Squeeze_hw:
mov x20,x1
mov x21,x2
mov x22,x3
.Loop_squeeze:
cmp x4, #0
bne .Lfirst_squeeze // if (first != 0) -> first block -> skip first Keccak
.Loop_squeeze: // Squeeze loop (Keccak & Store)
mov x0,x19
bl KeccakF1600
.Lfirst_squeeze:
mov x0,x19
mov x3,x22
.L_squeeze: // Store loop
ldr x4,[x0],#8
cmp x21,#8
blo .Lsqueeze_tail
blo .Lsqueeze_tail // Store tail only
#ifdef __AARCH64EB__
rev x4,x4
#endif
str x4,[x20],#8
subs x21,x21,#8
beq .Lsqueeze_done
ble .Lsqueeze_done
subs x3,x3,#8
bhi .Loop_squeeze
mov x0,x19
bl KeccakF1600
mov x0,x19
mov x3,x22
b .Loop_squeeze
bhi .L_squeeze // End store loop
b .Loop_squeeze // End Squeeze loop (Keccak & Store)
.align 4
.Lsqueeze_tail:
strb w4,[x20],#1
Expand Down
22 changes: 13 additions & 9 deletions generated-src/win-aarch64/crypto/fipsmodule/keccak1600-armv8.S
Original file line number Diff line number Diff line change
Expand Up @@ -497,23 +497,27 @@ SHA3_Squeeze_hw:
mov x20,x1
mov x21,x2
mov x22,x3
Loop_squeeze:
cmp x4, #0
bne Lfirst_squeeze // if (first != 0) -> first block -> skip first Keccak
Loop_squeeze: // Squeeze loop (Keccak & Store)
mov x0,x19
bl KeccakF1600
Lfirst_squeeze:
mov x0,x19
mov x3,x22
L_squeeze: // Store loop
ldr x4,[x0],#8
cmp x21,#8
blo Lsqueeze_tail
blo Lsqueeze_tail // Store tail only
#ifdef __AARCH64EB__
rev x4,x4
#endif
str x4,[x20],#8
subs x21,x21,#8
beq Lsqueeze_done
ble Lsqueeze_done
subs x3,x3,#8
bhi Loop_squeeze
mov x0,x19
bl KeccakF1600
mov x0,x19
mov x3,x22
b Loop_squeeze
bhi L_squeeze // End store loop
b Loop_squeeze // End Squeeze loop (Keccak & Store)
.align 4
Lsqueeze_tail:
strb w4,[x20],#1
Expand Down

0 comments on commit a8c5c5d

Please sign in to comment.