Harcode curve in semi-internal modMult function
Saves 80 bytes of code size.
diff --git a/tinycrypt/ecc_dsa.c b/tinycrypt/ecc_dsa.c
index 8462860..2df89a5 100644
--- a/tinycrypt/ecc_dsa.c
+++ b/tinycrypt/ecc_dsa.c
@@ -257,7 +257,7 @@
uECC_vli_modSub(z, sum, tx, curve->p, num_words); /* z = x2 - x1 */
XYcZ_add(tx, ty, sum, sum + num_words, curve);
uECC_vli_modInv(z, z, curve->p, num_words); /* z = 1/z */
- apply_z(sum, sum + num_words, z, curve);
+ apply_z(sum, sum + num_words, z);
/* Use Shamir's trick to calculate u1*G + u2*Q */
points[0] = 0;
@@ -283,15 +283,15 @@
if (point) {
uECC_vli_set(tx, point, num_words);
uECC_vli_set(ty, point + num_words, num_words);
- apply_z(tx, ty, z, curve);
+ apply_z(tx, ty, z);
uECC_vli_modSub(tz, rx, tx, curve->p, num_words); /* Z = x2 - x1 */
XYcZ_add(tx, ty, rx, ry, curve);
- uECC_vli_modMult_fast(z, z, tz, curve);
+ uECC_vli_modMult_fast(z, z, tz);
}
}
uECC_vli_modInv(z, z, curve->p, num_words); /* Z = 1/Z */
- apply_z(rx, ry, z, curve);
+ apply_z(rx, ry, z);
/* v = x1 (mod n) */
if (uECC_vli_cmp_unsafe(curve->n, rx, num_n_words) != 1) {