aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-02 18:33:14 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2015-06-02 18:33:14 +0200
commit31842a057f7420776f5452cebc429e88f20c433f (patch)
tree1281772ede767752a290583f883c6b93dbb7e42b /src/model
parentd23f8319c764eaa3712c129fab9d650c21eee34d (diff)
Padded Rob 1024 test with one 32-bit word. This makes the model work for the test case.
Diffstat (limited to 'src/model')
-rw-r--r--src/model/c/src/simple_tests.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/model/c/src/simple_tests.c b/src/model/c/src/simple_tests.c
index 68dcb2a..c7ac7a4 100644
--- a/src/model/c/src/simple_tests.c
+++ b/src/model/c/src/simple_tests.c
@@ -116,7 +116,7 @@ void small_e_256_mod(void) {
void rob_1024(void)
{
- uint32_t exponent[] = {0x3ff26c9e, 0x32685b93, 0x66570228, 0xf0603c4e,
+ uint32_t exponent[] = {0x00000000, 0x3ff26c9e, 0x32685b93, 0x66570228, 0xf0603c4e,
0x04a717c1, 0x8038b116, 0xeb48325e, 0xcada992a,
0x920bb241, 0x5aee4afe, 0xe2a37e87, 0xb35b9519,
0xb335775d, 0x989553e9, 0x1326f46e, 0x2cdf6b7b,
@@ -126,7 +126,7 @@ void rob_1024(void)
0x3172bed3, 0x73b6957c, 0xc0d6a68e, 0x33156a61};
- uint32_t modulus[] = {0xd075ec0a, 0x95048ef8, 0xcaa69073, 0x8d9d58e9,
+ uint32_t modulus[] = {0x00000000, 0xd075ec0a, 0x95048ef8, 0xcaa69073, 0x8d9d58e9,
0x1764b437, 0x50b58cad, 0x8a6e3199, 0x135f80ee,
0x84eb2bde, 0x58d38ee3, 0x5825e91e, 0xafdeb1ba,
0xa15a160b, 0x0057c47c, 0xc7765e31, 0x868a3e15,
@@ -136,7 +136,7 @@ void rob_1024(void)
0xe6c4ddbe, 0x7ee61f79, 0x265c6adf, 0xb16b3015};
- uint32_t message[] = {0x0001ffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ uint32_t message[] = {0x00000000, 0x0001ffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
@@ -146,7 +146,7 @@ void rob_1024(void)
0xfabbb92b, 0x741ca649, 0x6107074d, 0x0343b597};
- uint32_t expected[] = {0x06339a64, 0x367db02a, 0xf41158cc, 0x95e76049,
+ uint32_t expected[] = {0x00000000, 0x06339a64, 0x367db02a, 0xf41158cc, 0x95e76049,
0x4519c165, 0x111184be, 0xe41d8ee2, 0x2ae5f5d1,
0x1da7f962, 0xac93ac88, 0x915eee13, 0xa3350c22,
0xf0dfa62e, 0xfdfc2b62, 0x29f26e27, 0xbebdc84e,
@@ -156,7 +156,7 @@ void rob_1024(void)
0xcddb986a, 0xac75c2f2, 0xb044ed59, 0xea565879};
- uint32_t target[] = {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ uint32_t target[] = {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -167,8 +167,8 @@ void rob_1024(void)
printf("=== 1024 bit test from Robs RSA code. ===\n");
- mod_exp_array(32, message, exponent, modulus, target);
- assertArrayEquals(32, expected, target);
+ mod_exp_array(33, message, exponent, modulus, target);
+ assertArrayEquals(33, expected, target);
}