Skip to content

Commit

Permalink
Merge pull request wolfSSL#6947 from SparkiDev/sp_arm64_mont_red_4_fix
Browse files Browse the repository at this point in the history
SP ARM64 asm: fix Montgomery reduction by 4
  • Loading branch information
JacobBarthelmeh authored Nov 9, 2023
2 parents 2b1c61a + 01c3345 commit 73d3277
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wolfcrypt/src/sp_arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -40512,6 +40512,8 @@ static void sp_256_mont_mul_order_4(sp_digit* r, const sp_digit* a, const sp_dig
"adcs x11, x11, x3\n\t"
"umulh x4, x16, x17\n\t"
"adcs x12, x12, x4\n\t"
"# x15 == -1\n\t"
"adcs x19, x19, x15\n\t"
"csel x13, x13, xzr, cs\n\t"
"csel x14, x14, xzr, cs\n\t"
"csel x15, x15, xzr, cs\n\t"
Expand Down Expand Up @@ -40703,6 +40705,8 @@ static void sp_256_mont_sqr_order_4(sp_digit* r, const sp_digit* a)
"adcs x10, x10, x2\n\t"
"umulh x3, x15, x16\n\t"
"adcs x11, x11, x3\n\t"
"# x14 == -1\n\t"
"adcs x17, x17, x14\n\t"
"csel x12, x12, xzr, cs\n\t"
"csel x13, x13, xzr, cs\n\t"
"csel x14, x14, xzr, cs\n\t"
Expand Down Expand Up @@ -40889,6 +40893,8 @@ static void sp_256_mont_sqr_n_order_4(sp_digit* r, const sp_digit* a, int n)
"adcs x10, x10, x2\n\t"
"umulh x3, x15, x16\n\t"
"adcs x11, x11, x3\n\t"
"# x14 == -1\n\t"
"adcs x17, x17, x14\n\t"
"csel x12, x12, xzr, cs\n\t"
"csel x13, x13, xzr, cs\n\t"
"csel x14, x14, xzr, cs\n\t"
Expand Down

0 comments on commit 73d3277

Please sign in to comment.