]> git.ipfire.org Git - thirdparty/nettle.git/commit
Reduce output range of ecc_mod_sub.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 16 Aug 2022 17:47:20 +0000 (19:47 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 16 Aug 2022 17:47:20 +0000 (19:47 +0200)
commit62c74f1f489debc8a633f33e7b4872fb54a46000
tree004675fc0be1db2e72a938bf855b18c27ec234b9
parentff55a587fc8d7d571a0718191d3caab800b345ba
Reduce output range of ecc_mod_sub.

* ecc-mod-arith.c (ecc_mod_sub): Ensure that if inputs are in the
range 0 <= a, b < 2m, then output is in the same range.
* eccdata.c (output_curve): New outputs ecc_Bm2p and ecc_Bm2q.
* ecc-internal.h (struct ecc_modulo): New member Bm2m (B^size -
2m), needed by ecc_mod_sub. Update all curves.
* testsuite/ecc-mod-arith-test.c: New tests for ecc_mod_add and
ecc_mod_sub.
15 files changed:
ChangeLog
ecc-curve25519.c
ecc-curve448.c
ecc-gost-gc256b.c
ecc-gost-gc512a.c
ecc-internal.h
ecc-mod-arith.c
ecc-secp192r1.c
ecc-secp224r1.c
ecc-secp256r1.c
ecc-secp384r1.c
ecc-secp521r1.c
eccdata.c
testsuite/Makefile.in
testsuite/ecc-mod-arith-test.c [new file with mode: 0644]