From 3da17709b79b4b97e246e64a102da5276e0c2327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Mon, 29 Jun 2015 14:05:38 +0200 Subject: Adding a new test case for testing montprod with a lot of bit twiddling. --- src/model/c/src/ModExpTestBench.c | 4 ++-- src/model/c/src/simple_tests.c | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/model/c/src/ModExpTestBench.c b/src/model/c/src/ModExpTestBench.c index 9254992..1c54517 100644 --- a/src/model/c/src/ModExpTestBench.c +++ b/src/model/c/src/ModExpTestBench.c @@ -7,8 +7,8 @@ int main(void) { simple_tests(); - autogenerated_tests(); - montgomery_array_tests(0); + // autogenerated_tests(); + // montgomery_array_tests(0); print_assert_array_stats(); diff --git a/src/model/c/src/simple_tests.c b/src/model/c/src/simple_tests.c index 8c1ca44..5b8def9 100644 --- a/src/model/c/src/simple_tests.c +++ b/src/model/c/src/simple_tests.c @@ -230,14 +230,30 @@ void rob_enc_1024(void) } +void montprod_test1(void) +{ + uint32_t a_array[2] = {0xffeeffee, 0x12345678}; + uint32_t b_array[2] = {0xffeeffee, 0xaabbaabb}; + uint32_t m_array[2] = {0xffeeffee, 0xdeadbeef}; + uint32_t s_array[2]; + + printf("=== pure montgomery test case to get some data to drive optimization ===\n"); + + mont_prod_array(2, a_array, b_array, m_array, s_array); + + printf("s_array: 0x%08x 0x%08x\n", s_array[0], s_array[1]); +} + + void simple_tests(void) { // simple_3_7_11(); // simple_251_251_257(); // bigger_test(); // small_e_256_mod(); // small_e_64_mod(); - rob_enc_1024(); - rob_dec_1024(); + montprod_test1(); + // rob_enc_1024(); + // rob_dec_1024(); // small_e_256_mod2(); } -- cgit v1.2.3