]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Eliminate temporary working space for bigint_mod_invert()
authorMichael Brown <mcb30@ipxe.org>
Wed, 27 Nov 2024 12:51:04 +0000 (12:51 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 27 Nov 2024 13:05:18 +0000 (13:05 +0000)
commit7c2e68cc87a552c153e13517b0d0d6827f48e95b
tree234e3fee7656c0659207d84bb3eefc269551ddc6
parent9cbf5c4f86b45773badec2498fac22e8bc6d7dd1
[crypto] Eliminate temporary working space for bigint_mod_invert()

With a slight modification to the algorithm to ignore bits of the
residue that can never contribute to the result, it is possible to
reuse the as-yet uncalculated portions of the inverse to hold the
residue.  This removes the requirement for additional temporary
working space.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/bigint.c
src/include/ipxe/bigint.h
src/tests/bigint_test.c