Skip to content

Commit 95c177b

Browse files
committed
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).
1 parent 6ac0f82 commit 95c177b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wolfssl/wolfcrypt/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ enum Max_ASN {
23152315
MAX_ENCODED_SIG_SZ = 5120,
23162316
#elif !defined(NO_RSA)
23172317
#if defined(USE_FAST_MATH) && defined(FP_MAX_BITS)
2318-
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 8,
2318+
MAX_ENCODED_SIG_SZ = FP_MAX_BITS / 16,
23192319
#elif (defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)) && \
23202320
defined(SP_INT_BITS)
23212321
MAX_ENCODED_SIG_SZ = WC_BITS_TO_BYTES(SP_INT_BITS),

0 commit comments

Comments
 (0)