|
|
@@ -340,15 +340,19 @@ static bool TestECDSA_SIG_max_len(size_t order_len) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
static size_t BitsToBytes(size_t bits) { |
|
|
|
return (bits / 8) + (7 + (bits % 8)) / 8; |
|
|
|
} |
|
|
|
|
|
|
|
int main(void) { |
|
|
|
CRYPTO_library_init(); |
|
|
|
|
|
|
|
if (!TestBuiltin(stdout) || |
|
|
|
!TestECDSA_SIG_max_len(224/8) || |
|
|
|
!TestECDSA_SIG_max_len(256/8) || |
|
|
|
!TestECDSA_SIG_max_len(384/8) || |
|
|
|
!TestECDSA_SIG_max_len(512/8) || |
|
|
|
!TestECDSA_SIG_max_len(10000)) { |
|
|
|
!TestECDSA_SIG_max_len(BitsToBytes(224)) || |
|
|
|
!TestECDSA_SIG_max_len(BitsToBytes(256)) || |
|
|
|
!TestECDSA_SIG_max_len(BitsToBytes(384)) || |
|
|
|
!TestECDSA_SIG_max_len(BitsToBytes(521)) || |
|
|
|
!TestECDSA_SIG_max_len(BitsToBytes(10000))) { |
|
|
|
printf("\nECDSA test failed\n"); |
|
|
|
ERR_print_errors_fp(stdout); |
|
|
|
return 1; |
|
|
|