diff options
author | Michael Brown <mcb30@ipxe.org> | 2025-01-10 13:44:13 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2025-01-10 13:47:25 +0000 |
commit | d88eb0a1935942cdeccd3efee38f9765d2f1c235 (patch) | |
tree | 74c920dced82d2a576bcf7a034cd78c5136c89c6 /src/crypto/sha256.c | |
parent | 83ba34076ad4ca79be81a71f25303b340c60e7b8 (diff) | |
download | ipxe-d88eb0a1935942cdeccd3efee38f9765d2f1c235.tar.gz |
[crypto] Extract bigint_reduce_supremum() from bigint_mod_exp()
Calculating the Montgomery constant (R^2 mod N) is done in our
implementation by zeroing the double-width representation of N,
subtracting N once to give (R^2 - N) in order to obtain a positive
value, then reducing this value modulo N.
Extract this logic from bigint_mod_exp() to a separate function
bigint_reduce_supremum(), to allow for reuse by other code.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/sha256.c')
0 files changed, 0 insertions, 0 deletions