[Cryptech-Commits] [core/math/modexp] 05/05: Fixed final big testcase to match python model.

git at cryptech.is git at cryptech.is
Tue Jun 16 13:57:57 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 4f7b066afc92075d9c13b6ab423e2aa59b19284c
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Tue Jun 16 15:57:43 2015 +0200

    Fixed final big testcase to match python model.
---
 src/tb/tb_modexp.v | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/src/tb/tb_modexp.v b/src/tb/tb_modexp.v
index ca2ad8d..d250b0c 100644
--- a/src/tb/tb_modexp.v
+++ b/src/tb/tb_modexp.v
@@ -967,17 +967,6 @@ module tb_modexp();
       write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00000000);
       write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
 
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_PTR_RST}, 32'h00000000);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h00000000);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hf169d36e);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hbe2ce61d);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hc2e87809);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h4fed15c3);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h7c70eac5);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'ha123e643);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h299b36d2);
-      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h788e583b);
-
       write_word({GENERAL_PREFIX, ADDR_MODULUS_PTR_RST}, 32'h00000000);
       write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h00000000);
       write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hf169d36e);
@@ -989,6 +978,17 @@ module tb_modexp();
       write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h299b36d2);
       write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'h788e583b);
 
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hf169d36e);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hbe2ce61d);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hc2e87809);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h4fed15c3);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h7c70eac5);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'ha123e643);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h299b36d2);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'h788e583a);
+
       write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000009);
       write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000009);
 
@@ -1002,10 +1002,14 @@ module tb_modexp();
 
       write_word({GENERAL_PREFIX, ADDR_RESULT_PTR_RST}, 32'h00000000);
       read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h00000000, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h0ddc404d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h91600596, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h7425a8d8, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha066ca56, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf169d36e, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hbe2ce61d, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hc2e87809, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4fed15c3, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h7c70eac5, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'ha123e643, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h299b36d2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h788e583a, read_data);
 
       if (success !== 1)
         begin
@@ -1391,13 +1395,13 @@ module tb_modexp();
       reset_dut();
       dump_dut_state();
 
-      tc1();
-      tc2();
-      tc3();
+//      tc1();
+//      tc2();
+//      tc3();
 //      autogenerated_BASIC_33bit();
 //      autogenerated_BASIC_128bit();
-//      e65537_64bit_modulus();
-      e65537_128bit_modulus();
+      e65537_64bit_modulus();
+//      e65537_128bit_modulus();
 //      e65537_256bit_modulus();
 
 //      rob_dec_1024();



More information about the Commits mailing list