mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 15:30:49 +02:00
Set MAX_ENCODED_SIG_SZ to FP_MAX_BITS / 16 rather than / 8
FP_MAX_BITS is the largest possible size of any intermediate operand. RSA requires multiplying together integers with the size of signatures (N), resulting in a size of 2N. So we must assume FP_MAX_BITS is 2N, not N (in bits: 16N, not 8N).
This commit is contained in:
@@ -2315,7 +2315,7 @@ enum Max_ASN {
|
||||
MAX_ENCODED_SIG_SZ = 5120,
|
||||
#elif !defined(NO_RSA)
|
||||
#if defined(USE_FAST_MATH) && defined(FP_MAX_BITS)
|
||||
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 8,
|
||||
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 16,
|
||||
#elif (defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)) && \
|
||||
defined(SP_INT_BITS)
|
||||
MAX_ENCODED_SIG_SZ = WC_BITS_TO_BYTES(SP_INT_BITS),
|
||||
|
||||
Reference in New Issue
Block a user