[Cryptech-Commits] [core/math/modexp] 02/03: Adding a new test case for testing montprod with a lot of bit twiddling.

git at cryptech.is git at cryptech.is
Tue Jun 30 07:34:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch perfopt
in repository core/math/modexp.

commit 3da17709b79b4b97e246e64a102da5276e0c2327
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Mon Jun 29 14:05:38 2015 +0200

    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(-)

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();
 }
 



More information about the Commits mailing list