aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-29 14:05:38 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-29 14:05:38 +0200
commit3da17709b79b4b97e246e64a102da5276e0c2327 (patch)
tree71c6acd39e44a5007037bfaa7b062a312e6b9367 /src/model
parent4e43d0acb92dd3110b89e9b153b9c0ecb441c655 (diff)
Adding a new test case for testing montprod with a lot of bit twiddling.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/c/src/ModExpTestBench.c4
-rw-r--r--src/model/c/src/simple_tests.c20
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();
}