From fa155de5469627ae0ff942ea452f2f92f169767c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Wed, 4 Jul 2018 15:02:26 +0200 Subject: 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. --- src/tb/tb_aes.v | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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(); -- cgit v1.2.3