Skip to content

Commit

Permalink
Add comment describing ninv implementation trick
Browse files Browse the repository at this point in the history
  • Loading branch information
dop-amin committed Apr 7, 2024
1 parent 07e65bd commit d27a995
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_dilithium_1234_5678.s
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,9 @@ layer1234_start:
str_vo data14, in, (14*(512/8))
str_vo data15, in, (15*(512/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data4, data5, data6, data7, data0, data1, data2, data3, data4, data5, data6, data7

canonical_reduce data0, modulus_half, neg_modulus_half, t2, t3
Expand Down
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_dilithium_1234_5678_manual_ld4.s
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ layer1234_start:
str_vo data14, in, (14*(512/8))
str_vo data15, in, (15*(512/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data4, data5, data6, data7, data0, data1, data2, data3, data4, data5, data6, data7

canonical_reduce data0, modulus_half, neg_modulus_half, t2, t3
Expand Down
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_dilithium_123_45678.s
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ layer123_start:
str_vo data6, in, (6*(1024/8))
str_vo data7, in, (7*(1024/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data0, data1, data2, data3

canonical_reduce data0, modulus_half, neg_modulus_half, t2, t3
Expand Down
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_dilithium_123_45678_manual_ld4.s
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ layer123_start:
str_vo data6, in, (6*(1024/8))
str_vo data7, in, (7*(1024/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data0, data1, data2, data3

canonical_reduce data0, modulus_half, neg_modulus_half, t2, t3
Expand Down
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_kyber_123_4567.s
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,9 @@ layer123_start:
str_vo data6, in, (6*(512/8))
str_vo data7, in, (7*(512/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data0, data1, data2, data3

str_vi data0, in, (16)
Expand Down
3 changes: 3 additions & 0 deletions examples/naive/aarch64/intt_kyber_123_4567_manual_ld4.s
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ layer123_start:
str_vo data6, in, (6*(512/8))
str_vo data7, in, (7*(512/8))

// Scale half the coeffs by 1/n; for the other half, the scaling has
// been merged into the multiplication with the twiddle factor on the
// last layer.
mul_ninv data0, data1, data2, data3, data0, data1, data2, data3

str_vi data0, in, (16)
Expand Down

0 comments on commit d27a995

Please sign in to comment.