Merge pull request #10044 from SparkiDev/asm_gen_fixes_3

SP non-block ECC: correct mont_inv_order
This commit is contained in:
David Garske
2026-03-23 08:31:06 -07:00
committed by GitHub
7 changed files with 24 additions and 24 deletions
+3 -3
View File
@@ -79156,7 +79156,7 @@ static int sp_256_mont_inv_order_8_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_8(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 8U);
@@ -97352,7 +97352,7 @@ static int sp_384_mont_inv_order_12_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_384_mont_mul_order_12(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 12U);
@@ -125751,7 +125751,7 @@ static int sp_521_mont_inv_order_17_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_521_mont_mul_order_17(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 17U);
+3 -3
View File
@@ -40410,7 +40410,7 @@ static int sp_256_mont_inv_order_4_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_4(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 4U);
@@ -66248,7 +66248,7 @@ static int sp_384_mont_inv_order_6_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_384_mont_mul_order_6(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 6U);
@@ -110714,7 +110714,7 @@ static int sp_521_mont_inv_order_9_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_521_mont_mul_order_9(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 9U);
+3 -3
View File
@@ -104906,7 +104906,7 @@ static int sp_256_mont_inv_order_8_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_8(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 8U);
@@ -115433,7 +115433,7 @@ static int sp_384_mont_inv_order_12_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_384_mont_mul_order_12(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 12U);
@@ -130970,7 +130970,7 @@ static int sp_521_mont_inv_order_17_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_521_mont_mul_order_17(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 17U);
+3 -3
View File
@@ -23764,7 +23764,7 @@ static int sp_256_mont_inv_order_9_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_9(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 9U);
@@ -31437,7 +31437,7 @@ static int sp_384_mont_inv_order_15_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_384_mont_mul_order_15(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 15U);
@@ -39151,7 +39151,7 @@ static int sp_521_mont_inv_order_21_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_521_mont_mul_order_21(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 21U);
+3 -3
View File
@@ -24243,7 +24243,7 @@ static int sp_256_mont_inv_order_5_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_5(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 5U);
@@ -31307,7 +31307,7 @@ static int sp_384_mont_inv_order_7_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_384_mont_mul_order_7(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 7U);
@@ -38335,7 +38335,7 @@ static int sp_521_mont_inv_order_9_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_521_mont_mul_order_9(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 9U);
+3 -3
View File
@@ -40196,7 +40196,7 @@ static int sp_256_mont_inv_order_8_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_8(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 8U);
@@ -50204,7 +50204,7 @@ static int sp_384_mont_inv_order_12_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_384_mont_mul_order_12(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 12U);
@@ -63152,7 +63152,7 @@ static int sp_521_mont_inv_order_17_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const
sp_521_mont_mul_order_17(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 17U);
+6 -6
View File
@@ -24382,7 +24382,7 @@ static int sp_256_mont_inv_order_4_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_256_mont_mul_order_4(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 4U);
@@ -24605,7 +24605,7 @@ static int sp_256_mont_inv_order_avx2_4_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, co
sp_256_mont_mul_order_avx2_4(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 4U);
@@ -48945,7 +48945,7 @@ static int sp_384_mont_inv_order_6_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_384_mont_mul_order_6(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 6U);
@@ -49101,7 +49101,7 @@ static int sp_384_mont_inv_order_avx2_6_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, co
sp_384_mont_mul_order_avx2_6(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 6U);
@@ -89615,7 +89615,7 @@ static int sp_521_mont_inv_order_9_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, const s
sp_521_mont_mul_order_9(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 9U);
@@ -89784,7 +89784,7 @@ static int sp_521_mont_inv_order_avx2_9_nb(sp_ecc_ctx_t* sp_ctx, sp_digit* r, co
sp_521_mont_mul_order_avx2_9(t, t, a);
}
ctx->i--;
ctx->state = (ctx->i == 0) ? 3 : 1;
ctx->state = (ctx->i >= 0) ? 1 : 3;
break;
case 3:
XMEMCPY(r, t, sizeof(sp_digit) * 9U);