From bcd83686c3daed38974d1f9b533c07d35c5a7476 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 3 Nov 2014 22:16:51 +0000 Subject: Various small fixes and cleanups, new is_prime util --- src/tests/data/mp_valid.dat | 9 +++++++++ src/tests/test_pubkey.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/tests') diff --git a/src/tests/data/mp_valid.dat b/src/tests/data/mp_valid.dat index 1b45bf9bb..47a5df1f1 100644 --- a/src/tests/data/mp_valid.dat +++ b/src/tests/data/mp_valid.dat @@ -5419,6 +5419,10 @@ 2:1 3:1 4:0 +255:0 +257:1 +65517:0 +65521:1 65537:1 # This one passes Miller-Rabin with a base of 2, but not with most others @@ -5466,3 +5470,8 @@ 2701791887072337189992932234179329410389241899414841054215169960\ 1546741832617953638436279944072980418788682453341495300190580109\ 0622787969540076319408964006231:0 + +# Carmichael numbers +232250619601:0 +9746347772161:0 +340561:0 diff --git a/src/tests/test_pubkey.cpp b/src/tests/test_pubkey.cpp index 734ff1803..eec7e3bde 100644 --- a/src/tests/test_pubkey.cpp +++ b/src/tests/test_pubkey.cpp @@ -170,11 +170,11 @@ size_t validate_encryption(PK_Encryptor& e, PK_Decryptor& d, { std::vector message = hex_decode(input); std::vector expected = hex_decode(exp); - Fixed_Output_RNG rng(hex_decode(random)); + Fixed_Output_RNG kat_rng(hex_decode(random)); size_t fails = 0; - const std::vector ctext = e.encrypt(message, rng); + const std::vector ctext = e.encrypt(message, kat_rng); if(ctext != expected) { std::cout << "FAILED (encrypt): " << algo << std::endl; -- cgit v1.2.3