1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
diff --git a/ecc-gostdsa-verify.c b/ecc-gostdsa-verify.c
index 29b82c84..906abbf3 100644
--- a/ecc-gostdsa-verify.c
+++ b/ecc-gostdsa-verify.c
@@ -102,11 +102,11 @@ ecc_gostdsa_verify (const struct ecc_curve *ecc,
ecc->q.invert (&ecc->q, vp, hp, vp + 2*ecc->p.size);
/* z1 = s / h, P1 = z1 * G */
- ecc_mod_mul (&ecc->q, z1, sp, vp);
+ ecc_mod_mul_canonical (&ecc->q, z1, sp, vp);
/* z2 = - r / h, P2 = z2 * Y */
- ecc_mod_mul (&ecc->q, z2, rp, vp);
- mpn_sub_n (z2, ecc->q.m, z2, ecc->p.size);
+ mpn_sub_n (hp, ecc->q.m, rp, ecc->p.size);
+ ecc_mod_mul_canonical (&ecc->q, z2, hp, vp);
/* Total storage: 5*ecc->p.size + ecc->mul_itch */
ecc->mul (ecc, P2, z2, pp, z2 + ecc->p.size);
|