[Cryptech-Commits] [core/rng/trng] 01/01: Adding test case for verifying reseed functionality in csprng.
git at cryptech.is
git at cryptech.is
Wed Aug 26 13:53:50 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/rng/trng.
commit 01336260cf2df771cd246c131238ef70b23d3c10
Author: Joachim Strömbergson <joachim at secworks.se>
Date: Wed Aug 26 15:53:40 2015 +0200
Adding test case for verifying reseed functionality in csprng.
---
src/tb/tb_csprng.v | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/src/tb/tb_csprng.v b/src/tb/tb_csprng.v
index 0404b56..7f7823e 100644
--- a/src/tb/tb_csprng.v
+++ b/src/tb/tb_csprng.v
@@ -353,6 +353,7 @@ module tb_csprng();
tb_seed_data = {8{64'haaaaaaaa55555555}};
tb_seed_syn = 1'b1;
+ // Start pulling data.
tb_cs = 1'b1;
tb_we = 1'b0;
tb_address = ADDR_RND_DATA;
@@ -365,6 +366,46 @@ module tb_csprng();
//----------------------------------------------------------------
+ // tc2_reseed_csprng()
+ //
+ // TC2: Test that the CSPRNG is reseeded as expected.
+ // We set the max block size to a small value and pull data.
+ //----------------------------------------------------------------
+ task tc2_reseed_csprng();
+ begin
+ tc_ctr = tc_ctr + 1;
+
+ $display("*** TC2: Test reseed of CSPRNG started.");
+
+ tb_seed_data = {8{64'h0102030405060708}};
+ tb_seed_syn = 1'b1;
+
+ // Set the max block size to a low value
+ tb_cs = 1'b1;
+ tb_we = 1'b1;
+ tb_address = ADDR_NUM_BLOCKS_HIGH;
+ tb_write_data = 32'h00000000;
+ #(CLK_PERIOD);
+ tb_address = ADDR_NUM_BLOCKS_LOW;
+ tb_write_data = 32'h00000001;
+ #(CLK_PERIOD);
+ tb_cs = 1'b0;
+ tb_we = 1'b0;
+ #(CLK_PERIOD);
+
+ // Start pulling data.
+ tb_cs = 1'b1;
+ tb_we = 1'b0;
+ tb_address = ADDR_RND_DATA;
+
+ #(200 * CLK_PERIOD);
+
+ $display("*** TC2 done..");
+ end
+ endtask // tc2_reseed_csprng
+
+
+ //----------------------------------------------------------------
// csprng_test
//
// The main test functionality.
@@ -382,6 +423,7 @@ module tb_csprng();
dump_dut_state();
tc1_init_csprng();
+ tc2_reseed_csprng();
display_test_results();
More information about the Commits
mailing list