[Cryptech-Commits] [core/math/modexp] 01/01: Fixed missing parenthesis in block memories that reduced mem sizes. Added test cases that verifies that we can work with 2048 bit operands.

git at cryptech.is git at cryptech.is
Tue Jun 30 14:44:12 UTC 2015


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

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

commit e61c65059054df407206e58b88a1b203f5ad3c3e
Author: Joachim Strömbergson <joachim at secworks.se>
Date:   Tue Jun 30 16:44:06 2015 +0200

    Fixed missing parenthesis in block memories that reduced mem sizes. Added test cases that verifies that we can work with 2048 bit operands.
---
 src/rtl/blockmem2r1w.v    |   2 +-
 src/rtl/blockmem2r1wptr.v |   2 +-
 src/rtl/blockmem2rptr1w.v |   2 +-
 src/tb/tb_modexp.v        | 531 ++++++++++++++++++++++++++++++++++++++++------
 4 files changed, 469 insertions(+), 68 deletions(-)

diff --git a/src/rtl/blockmem2r1w.v b/src/rtl/blockmem2r1w.v
index 557e810..aa44101 100644
--- a/src/rtl/blockmem2r1w.v
+++ b/src/rtl/blockmem2r1w.v
@@ -54,7 +54,7 @@ module blockmem2r1w #(parameter OPW = 32, parameter ADW = 8)
                     input wire  [(OPW - 1) : 0] write_data
                    );
 
-  reg [(OPW - 1) : 0] mem [0 :  (ADW ** 2 - 1)];
+  reg [(OPW - 1) : 0] mem [0 : ((2**ADW) - 1)];
   reg [(OPW - 1) : 0] tmp_read_data0;
   reg [(OPW - 1) : 0] tmp_read_data1;
 
diff --git a/src/rtl/blockmem2r1wptr.v b/src/rtl/blockmem2r1wptr.v
index b9abfa8..2435cfd 100644
--- a/src/rtl/blockmem2r1wptr.v
+++ b/src/rtl/blockmem2r1wptr.v
@@ -67,7 +67,7 @@ module blockmem2r1wptr #(parameter OPW = 32, parameter ADW = 8)
   //----------------------------------------------------------------
   // Memories and regs including update variables and write enable.
   //----------------------------------------------------------------
-  reg [(OPW - 1) : 0] mem [0 :  (ADW ** 2 - 1)];
+  reg [(OPW - 1) : 0] mem [0 : ((2**ADW) - 1)];
   reg [(OPW - 1) : 0] tmp_read_data0;
   reg [31 : 0]        tmp_read_data1;
 
diff --git a/src/rtl/blockmem2rptr1w.v b/src/rtl/blockmem2rptr1w.v
index fc7d83a..a1d7448 100644
--- a/src/rtl/blockmem2rptr1w.v
+++ b/src/rtl/blockmem2rptr1w.v
@@ -65,7 +65,7 @@ module blockmem2rptr1w #(parameter OPW = 32, parameter ADW = 8)
   //----------------------------------------------------------------
   // Memories and regs including update variables and write enable.
   //----------------------------------------------------------------
-  reg [(OPW - 1) : 0] mem [0 :  (ADW ** 2 - 1)];
+  reg [(OPW - 1) : 0] mem [0 : ((2**ADW) - 1)];
   reg [(OPW - 1) : 0] tmp_read_data0;
   reg [31 : 0]        tmp_read_data1;
 
diff --git a/src/tb/tb_modexp.v b/src/tb/tb_modexp.v
index 23e9f13..637d5a7 100644
--- a/src/tb/tb_modexp.v
+++ b/src/tb/tb_modexp.v
@@ -1257,6 +1257,405 @@ module tb_modexp();
 
 
   //----------------------------------------------------------------
+  // e65537_1536bit_modulus()
+  //
+  // Task that tests modexp with small exponent and
+  // 1536 bit modulus.
+  //----------------------------------------------------------------
+  task e65537_1536bit_modulus();
+    reg [31 : 0] read_data;
+    begin
+      success = 32'h1;
+      tc_ctr = tc_ctr + 1;
+      $display("Test with e = 65537 and 1536 bit modulus.");
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
+
+      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'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+
+
+      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'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000031);
+
+      start_test_cycle_ctr();
+
+      // Start processing and wait for ready.
+      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
+      wait_ready();
+
+      stop_test_cycle_ctr();
+
+      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'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4ade4f46, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h02cb4a2f, read_data);
+
+      if (success !== 1)
+        begin
+          $display("*** ERROR: e65537_1536bit_modulus was NOT successful.");
+          error_ctr = error_ctr + 1;
+        end
+      else
+        $display("*** e65537_1536bit_modulus success.");
+    end
+  endtask // e65537_1536bit_modulus
+
+
+
+  //----------------------------------------------------------------
+  // e65537_1664bit_modulus()
+  //
+  // Task that tests modexp with small exponent and
+  // 1664 bit modulus.
+  //----------------------------------------------------------------
+  task e65537_1664bit_modulus();
+    reg [31 : 0] read_data;
+    begin
+      success = 32'h1;
+      tc_ctr = tc_ctr + 1;
+      $display("Test with e = 65537 and 1664 bit modulus.");
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_PTR_RST}, 32'h00000000);
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_DATA}, 32'h00010001);
+
+      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'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_DATA}, 32'hffeeffef);
+
+
+      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'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hffaabbcc);
+      write_word({GENERAL_PREFIX, ADDR_MESSAGE_DATA}, 32'hddeeffff);
+
+      write_word({GENERAL_PREFIX, ADDR_EXPONENT_LENGTH}, 32'h00000001);
+      write_word({GENERAL_PREFIX, ADDR_MODULUS_LENGTH}, 32'h00000035);
+
+      start_test_cycle_ctr();
+
+      // Start processing and wait for ready.
+      write_word({GENERAL_PREFIX, ADDR_CTRL}, 32'h00000001);
+      wait_ready();
+
+      stop_test_cycle_ctr();
+
+      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'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h88671c15, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h2aeeb8b2, read_data);
+
+      if (success !== 1)
+        begin
+          $display("*** ERROR: e65537_1664bit_modulus was NOT successful.");
+          error_ctr = error_ctr + 1;
+        end
+      else
+        $display("*** e65537_1664it_modulus success.");
+    end
+  endtask // e65537_1664bit_modulus
+
+
+  //----------------------------------------------------------------
   // e65537_2048bit_modulus()
   //
   // Task that tests modexp with small exponent and
@@ -1420,70 +1819,71 @@ 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'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h1662df7d, read_data);
-      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hcbe66eb1, read_data);
+
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'hf1752196, read_data);
+      read_word({GENERAL_PREFIX, ADDR_RESULT_DATA}); read_data = tb_read_data; success = success & assertEquals(32'h4c36e92f, read_data);
 
       if (success !== 1)
         begin
@@ -1880,8 +2280,9 @@ module tb_modexp();
 //      e65537_128bit_modulus();
 //      e65537_256bit_modulus();
 //      e65537_1024bit_modulus();
+//      e65537_1536bit_modulus();
+//      e65537_1664bit_modulus();
       e65537_2048bit_modulus();
-//      e65537_2048bit_modulus();
 //      rob_dec_1024();
 //      rob_enc_1024();
 



More information about the Commits mailing list