Commit c24b3616 authored by Niels Möller's avatar Niels Möller
Browse files

Ensure ecdsa_sign output is canonically reduced.

* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Ensure s output is reduced to
canonical range.
parent 2397757b
2021-03-13 Niels Möller <nisse@lysator.liu.se>
* ecc-ecdsa-sign.c (ecc_ecdsa_sign): Ensure s output is reduced to
canonical range.
* ecc-ecdsa-verify.c (ecc_ecdsa_verify): Use ecc_mod_mul_canonical
to compute the scalars used for ecc multiplication.
* testsuite/ecdsa-verify-test.c (test_main): Add test case that
......
......@@ -91,9 +91,8 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc,
ecc_mod_mul (&ecc->q, tp, zp, rp, tp);
ecc_mod_add (&ecc->q, hp, hp, tp);
ecc_mod_mul (&ecc->q, tp, hp, kinv, tp);
ecc_mod_mul_canonical (&ecc->q, sp, hp, kinv, tp);
mpn_copyi (sp, tp, ecc->p.size);
#undef P
#undef hp
#undef kinv
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment