Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Luc Libralesso
cryptodag
Commits
42a2e126
Commit
42a2e126
authored
Dec 23, 2020
by
Luc Libralesso
Browse files
add another test for AES keyschedule 128
parent
997c5110
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/nodes/exec_aes_keyschedule.rb
View file @
42a2e126
...
...
@@ -78,4 +78,29 @@ class TestExecAesKeySchedule < Minitest::Unit::TestCase
0x9b
,
0x98
,
0x98
,
0xc9
,
0xf9
,
0xfb
,
0xfb
,
0xaa
,
0x9b
,
0x98
,
0x98
,
0xc9
,
0xf9
,
0xfb
,
0xfb
,
0xaa
])
end
def
test_chain_aes128
()
k
=
InputNode
.
new
(
name
:"K0"
,
dimensions
:[
4
,
4
])
ks1
=
AESKeyScheduleNode
.
new
(
name
:"KS1"
,
input
:k
.
outputs
[
0
],
subtable
:@sbox
,
rcon
:
1
)
ks2
=
AESKeyScheduleNode
.
new
(
name
:"KS2"
,
input
:ks1
.
outputs
[
0
],
subtable
:@sbox
,
rcon
:
2
)
computed_outputs
=
compute_set_of_operators
(
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
[
k
.
outputs
[
0
][
0
][
0
],
k
.
outputs
[
0
][
1
][
0
],
k
.
outputs
[
0
][
2
][
0
],
k
.
outputs
[
0
][
3
][
0
],
k
.
outputs
[
0
][
0
][
1
],
k
.
outputs
[
0
][
1
][
1
],
k
.
outputs
[
0
][
2
][
1
],
k
.
outputs
[
0
][
3
][
1
],
k
.
outputs
[
0
][
0
][
2
],
k
.
outputs
[
0
][
1
][
2
],
k
.
outputs
[
0
][
2
][
2
],
k
.
outputs
[
0
][
3
][
2
],
k
.
outputs
[
0
][
0
][
3
],
k
.
outputs
[
0
][
1
][
3
],
k
.
outputs
[
0
][
2
][
3
],
k
.
outputs
[
0
][
3
][
3
],
],
[
ks2
.
outputs
[
0
][
0
][
0
],
ks2
.
outputs
[
0
][
1
][
0
],
ks2
.
outputs
[
0
][
2
][
0
],
ks2
.
outputs
[
0
][
3
][
0
],
ks2
.
outputs
[
0
][
0
][
1
],
ks2
.
outputs
[
0
][
1
][
1
],
ks2
.
outputs
[
0
][
2
][
1
],
ks2
.
outputs
[
0
][
3
][
1
],
ks2
.
outputs
[
0
][
0
][
2
],
ks2
.
outputs
[
0
][
1
][
2
],
ks2
.
outputs
[
0
][
2
][
2
],
ks2
.
outputs
[
0
][
3
][
2
],
ks2
.
outputs
[
0
][
0
][
3
],
ks2
.
outputs
[
0
][
1
][
3
],
ks2
.
outputs
[
0
][
2
][
3
],
ks2
.
outputs
[
0
][
3
][
3
],
],
ks1
.
operators
+
ks2
.
operators
)
assert_equal
(
computed_outputs
,
[
0x9b
,
0x98
,
0x98
,
0xc9
,
0xf9
,
0xfb
,
0xfb
,
0xaa
,
0x9b
,
0x98
,
0x98
,
0xc9
,
0xf9
,
0xfb
,
0xfb
,
0xaa
])
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment