Prime Number Testing

1. Remove a copy-paste error when clearing up the RNG used to test a prime.
2. Tag a some const test values as static in the wolfCrypt test.
This commit is contained in:
John Safranek
2018-08-01 14:49:06 -07:00
parent 4b8507813e
commit 7647d52d77
2 changed files with 5 additions and 6 deletions

View File

@@ -22574,7 +22574,6 @@ int wolfSSL_BN_is_prime_ex(const WOLFSSL_BIGNUM *bn, int nbchecks,
if (initTmpRng)
wc_FreeRng(tmpRNG);
#ifdef WOLFSSL_SMALL_STACK
tmpRNG = (WC_RNG*)XMALLOC(sizeof(WC_RNG), NULL, DYNAMIC_TYPE_RNG);
XFREE(tmpRNG, NULL, DYNAMIC_TYPE_RNG);
#endif

View File

@@ -19157,28 +19157,28 @@ p1 = 2^192 * 0x000000000000e24fd4f6d6363200bf2323ec46285cac1d3a
+ 2^0 * 0x0b2488b0c29d96c5e67f8bec15b54b189ae5636efe89b45b
*/
const unsigned char c192a[] =
static const unsigned char c192a[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x4f,
0xd4, 0xf6, 0xd6, 0x36, 0x32, 0x00, 0xbf, 0x23,
0x23, 0xec, 0x46, 0x28, 0x5c, 0xac, 0x1d, 0x3a
};
const unsigned char c0a[] =
static const unsigned char c0a[] =
{
0x0b, 0x24, 0x88, 0xb0, 0xc2, 0x9d, 0x96, 0xc5,
0xe6, 0x7f, 0x8b, 0xec, 0x15, 0xb5, 0x4b, 0x18,
0x9a, 0xe5, 0x63, 0x6e, 0xfe, 0x89, 0xb4, 0x5b
};
const pairs_t ecPairsA[] =
static const pairs_t ecPairsA[] =
{
{c192a, sizeof(c192a), 192},
{c0a, sizeof(c0a), 0}
};
const int kA[] = {173, 293};
static const int kA[] = {173, 293};
const unsigned char controlPrime[] = {
static const unsigned char controlPrime[] = {
0xe1, 0x76, 0x45, 0x80, 0x59, 0xb6, 0xd3, 0x49,
0xdf, 0x0a, 0xef, 0x12, 0xd6, 0x0f, 0xf0, 0xb7,
0xcb, 0x2a, 0x37, 0xbf, 0xa7, 0xf8, 0xb5, 0x4d,