aboutsummaryrefslogtreecommitdiff
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
parent4e43d0acb92dd3110b89e9b153b9c0ecb441c655 (diff)
Adding a new test case for testing montprod with a lot of bit twiddling.
-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();
}
133'>133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249