aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha256.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2025-01-10 13:44:13 +0000
committerMichael Brown <mcb30@ipxe.org>2025-01-10 13:47:25 +0000
commitd88eb0a1935942cdeccd3efee38f9765d2f1c235 (patch)
tree74c920dced82d2a576bcf7a034cd78c5136c89c6 /src/crypto/sha256.c
parent83ba34076ad4ca79be81a71f25303b340c60e7b8 (diff)
downloadipxe-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