Skip to content

Commit

Permalink
Add bignum_{sqr,mul}_p521_neon
Browse files Browse the repository at this point in the history
This adds `bignum_{sqr,mul}_p521_neon` and their proofs.

The new subroutine specs are added to specification.txt, and test as well as benchmark are updated.

Benchmark results on GV2 are:

```
bignum_mul_p521                 :   135.1 ns each (var  0.2%, corr -0.01) =    7404184 ops/sec
bignum_mul_p521_neon            :   115.5 ns each (var  0.3%, corr  0.00) =    8660108 ops/sec
bignum_sqr_p521                 :   108.9 ns each (var  0.2%, corr  0.08) =    9184994 ops/sec
bignum_sqr_p521_neon            :    78.7 ns each (var  0.3%, corr  0.06) =   12708368 ops/sec
```
  • Loading branch information
aqjune-aws committed Jun 25, 2024
1 parent e6ac9bd commit 02df8e4
Show file tree
Hide file tree
Showing 14 changed files with 4,921 additions and 107 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.correct
*.o
*.obj
.vscode
tests/test
tests/ctCheck
benchmarks/benchmark
Expand Down
2 changes: 2 additions & 0 deletions arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,12 @@ BIGNUM_OBJ = curve25519/bignum_add_p25519.o \
p521/bignum_montsqr_p521_neon.o \
p521/bignum_mul_p521.o \
p521/bignum_mul_p521_alt.o \
p521/bignum_mul_p521_neon.o \
p521/bignum_neg_p521.o \
p521/bignum_optneg_p521.o \
p521/bignum_sqr_p521.o \
p521/bignum_sqr_p521_alt.o \
p521/bignum_sqr_p521_neon.o \
p521/bignum_sub_p521.o \
p521/bignum_tolebytes_p521.o \
p521/bignum_tomont_p521.o \
Expand Down
2 changes: 2 additions & 0 deletions arm/p521/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ OBJ = bignum_add_p521.o \
bignum_montsqr_p521_neon.o \
bignum_mul_p521.o \
bignum_mul_p521_alt.o \
bignum_mul_p521_neon.o \
bignum_neg_p521.o \
bignum_optneg_p521.o \
bignum_sqr_p521.o \
bignum_sqr_p521_alt.o \
bignum_sqr_p521_neon.o \
bignum_sub_p521.o \
bignum_tolebytes_p521.o \
bignum_tomont_p521.o \
Expand Down
2 changes: 1 addition & 1 deletion arm/p521/bignum_montsqr_p521_neon.S
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
// The bash script used for step 2 is as follows:
//
// # Store the assembly instructions except the last 'ret',
// # callee-register store/loads and add/sub sp #80 as, say, 'input.S'.
// # callee-register store/loads as, say, 'input.S'.
// export OUTPUTS="[hint_buffer0,hint_buffer16,hint_buffer32,hint_buffer48,hint_buffer64]"
// export RESERVED_REGS="[x18,x25,x26,x27,x28,x29,x30,sp,q8,q9,q10,q11,q12,q13,q14,q15,v8,v9,v10,v11,v12,v13,v14,v15]"
// <s2n-bignum>/tools/external/slothy.sh input.S my_out_dir
Expand Down
Loading

0 comments on commit 02df8e4

Please sign in to comment.