diff options
author | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-04 15:02:26 +0200 |
---|---|---|
committer | Joachim StroĢmbergson <joachim@secworks.se> | 2018-07-04 15:02:26 +0200 |
commit | fa155de5469627ae0ff942ea452f2f92f169767c (patch) | |
tree | cee21ec2c98da8239b47311fa5b21cfd980705f8 /src/tb | |
parent | 4c94cf218237bf8bd3afef0f1828361baa284547 (diff) |
Added a test case for AES with test vectors from processing NIST KWP keywrap operation. This verifies that we are using the AES core correctly in the keywrap core. But it is a new test vector for AES too.
Diffstat (limited to 'src/tb')
-rw-r--r-- | src/tb/tb_aes.v | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tb/tb_aes.v b/src/tb/tb_aes.v index 35fc1d9..1e229d9 100644 --- a/src/tb/tb_aes.v +++ b/src/tb/tb_aes.v @@ -531,6 +531,33 @@ module tb_aes(); endtask // aes_test + + //---------------------------------------------------------------- + // nist_kwp_ae_128_test() + // + // Test that we can perform operations based on NIST KWP + // AE 128 test vectors. + //---------------------------------------------------------------- + task nist_kwp_ae_128_test; + reg [255 : 0] kwp_key; + reg [127 : 0] kwp_plaintext; + reg [127 : 0] kwp_expected; + + begin + kwp_key = 256'hc03db3cc1416dcd1c069a195a8d77e3d00000000000000000000000000000000; + kwp_plaintext = 128'ha65959a60000001f46f87f58cdda4200; + kwp_expected = 128'hd1bac797ff82fa4bde9f7490729fd0a7; + + $display(""); + $display("NIST KWP AE 128 bit test"); + + ecb_mode_single_block_test(8'h01, AES_ENCIPHER, kwp_key, AES_128_BIT_KEY, + kwp_plaintext, kwp_expected); + end + endtask // nist_kwp_ae_128_test + + + //---------------------------------------------------------------- // main // @@ -548,6 +575,7 @@ module tb_aes(); dump_dut_state(); aes_test(); + nist_kwp_ae_128_test(); display_test_results(); |