Skip to content

Commit

Permalink
Update Kyber and Dilithium tests for invNTT
Browse files Browse the repository at this point in the history
  • Loading branch information
dop-amin committed Apr 18, 2024
1 parent 785253f commit 534ac61
Show file tree
Hide file tree
Showing 36 changed files with 30,981 additions and 20,505 deletions.
295 changes: 84 additions & 211 deletions tests/ntt_dilithium/main.c

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions tests/ntt_dilithium/manual/intt_dilithium_1234_5678.s
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
trn1_d \data\()1, t1, t3
.endm

.macro save_gprs // slothy:no-unfold
.macro save_gprs // @slothy:no-unfold
sub sp, sp, #(16*6)
stp x19, x20, [sp, #16*0]
stp x19, x20, [sp, #16*0]
Expand All @@ -188,7 +188,7 @@
str x29, [sp, #16*5]
.endm

.macro restore_gprs // slothy:no-unfold
.macro restore_gprs // @slothy:no-unfold
ldp x19, x20, [sp, #16*0]
ldp x21, x22, [sp, #16*1]
ldp x23, x24, [sp, #16*2]
Expand All @@ -198,15 +198,15 @@
add sp, sp, #(16*6)
.endm

.macro save_vregs // slothy:no-unfold
.macro save_vregs // @slothy:no-unfold
sub sp, sp, #(16*4)
stp d8, d9, [sp, #16*0]
stp d10, d11, [sp, #16*1]
stp d12, d13, [sp, #16*2]
stp d14, d15, [sp, #16*3]
.endm

.macro restore_vregs // slothy:no-unfold
.macro restore_vregs // @slothy:no-unfold
ldp d8, d9, [sp, #16*0]
ldp d10, d11, [sp, #16*1]
ldp d12, d13, [sp, #16*2]
Expand All @@ -217,19 +217,19 @@
#define STACK_SIZE 16
#define STACK0 0

.macro restore a, loc // slothy:no-unfold
.macro restore a, loc // @slothy:no-unfold
ldr \a, [sp, #\loc\()]
.endm
.macro save loc, a // slothy:no-unfold
.macro save loc, a // @slothy:no-unfold
str \a, [sp, #\loc\()]
.endm
.macro push_stack // slothy:no-unfold
.macro push_stack // @slothy:no-unfold
save_gprs
save_vregs
sub sp, sp, #STACK_SIZE
.endm

.macro pop_stack // slothy:no-unfold
.macro pop_stack // @slothy:no-unfold
add sp, sp, #STACK_SIZE
restore_vregs
restore_gprs
Expand Down
16 changes: 8 additions & 8 deletions tests/ntt_dilithium/manual/intt_dilithium_1234_5678_manual_ld4.s
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
trn1_d \data\()1, t1, t3
.endm

.macro save_gprs // slothy:no-unfold
.macro save_gprs // @slothy:no-unfold
sub sp, sp, #(16*6)
stp x19, x20, [sp, #16*0]
stp x19, x20, [sp, #16*0]
Expand All @@ -188,7 +188,7 @@
str x29, [sp, #16*5]
.endm

.macro restore_gprs // slothy:no-unfold
.macro restore_gprs // @slothy:no-unfold
ldp x19, x20, [sp, #16*0]
ldp x21, x22, [sp, #16*1]
ldp x23, x24, [sp, #16*2]
Expand All @@ -198,15 +198,15 @@
add sp, sp, #(16*6)
.endm

.macro save_vregs // slothy:no-unfold
.macro save_vregs // @slothy:no-unfold
sub sp, sp, #(16*4)
stp d8, d9, [sp, #16*0]
stp d10, d11, [sp, #16*1]
stp d12, d13, [sp, #16*2]
stp d14, d15, [sp, #16*3]
.endm

.macro restore_vregs // slothy:no-unfold
.macro restore_vregs // @slothy:no-unfold
ldp d8, d9, [sp, #16*0]
ldp d10, d11, [sp, #16*1]
ldp d12, d13, [sp, #16*2]
Expand All @@ -217,19 +217,19 @@
#define STACK_SIZE 16
#define STACK0 0

.macro restore a, loc // slothy:no-unfold
.macro restore a, loc // @slothy:no-unfold
ldr \a, [sp, #\loc\()]
.endm
.macro save loc, a // slothy:no-unfold
.macro save loc, a // @slothy:no-unfold
str \a, [sp, #\loc\()]
.endm
.macro push_stack // slothy:no-unfold
.macro push_stack // @slothy:no-unfold
save_gprs
save_vregs
sub sp, sp, #STACK_SIZE
.endm

.macro pop_stack // slothy:no-unfold
.macro pop_stack // @slothy:no-unfold
add sp, sp, #STACK_SIZE
restore_vregs
restore_gprs
Expand Down
Loading

0 comments on commit 534ac61

Please sign in to comment.