]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Correct harmless arithmetic error in Weierstrass curve sizing master 1810/head
authorMichael Brown <mcb30@ipxe.org>
Sun, 9 Aug 2026 21:41:28 +0000 (22:41 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 9 Aug 2026 21:51:42 +0000 (22:51 +0100)
commit8baf1cda7762b6ee880502ac1d6f507a22959a36
treec7ba9bb9b094b924af4d78ab7464b999d2479625
parent2fa9f8b1e15f79e5fb3a1cb62f6ab1dd498bd654
[crypto] Correct harmless arithmetic error in Weierstrass curve sizing

The calculation of the number of zero padding bits required to ensure
that relaxed Montgomery multiplication produces a result in the chosen
range is incorrect: the requirement is k=m^2 rather than k=m.

This makes no difference to the code: for both P-256 and P-384, adding
any zero padding bits will cause an extra big integer element to be
used.  This extra element provides 32 (or 64) zero padding bits, which
is many more than are required to ensure that relaxed Montgomery
multiplication produces a result in the chosen range.

Fix the calculation, and update the comments to match.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/weierstrass.h