File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ // src: https://github.com/ekiwi/paso/blob/ad2bf83f420ca704ff0e76e7a583791a0e80a545/benchmarks/src/benchmarks/aes/TinyAESSpec.scala#L220
2+
3+ struct TinyAES128 {
4+ in key: u128,
5+ in state: u128,
6+ out output: u128,
7+ }
8+
9+ fn aes128<dut : TinyAES128>(in key: u128, in state: u128, out output: u128) {
10+ dut.state := state;
11+ dut.key := key;
12+ step();
13+ fork();
14+ dut.state := X;
15+ dut.key := X;
16+ // twenty cycles to complete
17+ step(20);
18+ assert_eq(dut.output, output);
19+ }
Original file line number Diff line number Diff line change 1+ // src: https://github.com/ekiwi/paso/blob/ad2bf83f420ca704ff0e76e7a583791a0e80a545/benchmarks/src/benchmarks/aes/TinyAESSpec.scala#L179
2+
3+ struct ExpandKey128 {
4+ in input: u128,
5+ out output: u128,
6+ out output_delayed: u128,
7+ }
8+
9+ fn aes128<dut : ExpandKey128>(in input: u128, out output: u128) {
10+ dut.input := input;
11+ step();
12+ fork();
13+ dut.input := X;
14+ assert_eq(dut.output, output);
15+ step();
16+ assert_eq(dut.output_delayed, output);
17+ }
Original file line number Diff line number Diff line change 1+ // src: https://github.com/ekiwi/paso/blob/ad2bf83f420ca704ff0e76e7a583791a0e80a545/benchmarks/src/benchmarks/aes/TinyAESSpec.scala#L164
2+
3+ struct RoundIO {
4+ in state: u128,
5+ in key: u128,
6+ out state_next: u128,
7+ }
8+
9+ fn aes128<dut : RoundIO>(in key: u128, in state: u128, out output: u128) {
10+ dut.state := state;
11+ step();
12+ fork();
13+ dut.state := X;
14+ dut.key := key;
15+ step();
16+ dut.key := X;
17+ assert_eq(dut.state_next, output);
18+ }
You can’t perform that action at this time.
0 commit comments