]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Force caller to provide temporary storage for modular calculations
authorMichael Brown <mcb30@ipxe.org>
Sun, 18 Mar 2012 20:02:25 +0000 (20:02 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sun, 18 Mar 2012 20:22:43 +0000 (20:22 +0000)
commit3ec773cd2b9d32c5a4bb3a7a6ae86e49fd278c8f
tree743d5b133e4469d9644319fd54f81c06822711c5
parent5af9e6219646ace094cfe35caa0125cbff8f38f8
[crypto] Force caller to provide temporary storage for modular calculations

bigint_mod_multiply() and bigint_mod_exp() require a fixed amount of
temporary storage for intermediate results.  (The amount of temporary
storage required depends upon the size of the integers involved.)

When performing calculations for 4096-bit RSA the amount of temporary
storage space required will exceed 2.5kB, which is too much to
allocate on the stack.  Avoid this problem by forcing the caller to
allocate temporary storage.

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