-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a95e775
commit 115114f
Showing
3 changed files
with
151 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/* | ||
* A collection of very small unit tests to check that internal | ||
* functions used by multiple crypto extension instructions give the correct | ||
* results given known inputs. | ||
*/ | ||
|
||
|
||
val crypto_test_vaes_128_keystep_fwd : unit -> bool | ||
function crypto_test_vaes_128_keystep_fwd () = { | ||
let input : bits(128) = 0x09cf4f3cabf7158828aed2a62b7e1516; | ||
let grm_out1: bits(128) = 0x2A6C760523A3393988542CB1A0FAFE17; | ||
let dut_out1: bits(128) = vaes128_keystep_fwd(input, 0x0); | ||
if(dut_out1 != grm_out1) then false else { | ||
let grm_out2: bits(128) = 0x7359f67f5935807a7a96b943f2c295f2; | ||
let dut_out2: bits(128) = vaes128_keystep_fwd(dut_out1, 0x1); | ||
if(dut_out2 != grm_out2) then false else true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters