aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/rsa.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-03-18 20:02:25 +0000
committerMichael Brown <mcb30@ipxe.org>2012-03-18 20:22:43 +0000
commit3ec773cd2b9d32c5a4bb3a7a6ae86e49fd278c8f (patch)
tree743d5b133e4469d9644319fd54f81c06822711c5 /src/include/ipxe/rsa.h
parent5af9e6219646ace094cfe35caa0125cbff8f38f8 (diff)
downloadipxe-3ec773cd2b9d32c5a4bb3a7a6ae86e49fd278c8f.tar.gz
[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>
Diffstat (limited to 'src/include/ipxe/rsa.h')
-rw-r--r--src/include/ipxe/rsa.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/rsa.h b/src/include/ipxe/rsa.h
index e70362ce7..87e75a82f 100644
--- a/src/include/ipxe/rsa.h
+++ b/src/include/ipxe/rsa.h
@@ -129,6 +129,8 @@ struct rsa_context {
bigint_element_t *input0;
/** Output buffer */
bigint_element_t *output0;
+ /** Temporary working space for modular exponentiation */
+ void *tmp;
};
extern struct pubkey_algorithm rsa_algorithm;