Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e76f5b18
authored
Mar 31, 2020
by
Enrico Pozzobon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test vector without AD
parent
c87607fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
test_common.py
+21
-0
No files found.
test_common.py
View file @
e76f5b18
...
...
@@ -601,8 +601,29 @@ def identify_test_vector(kat_path):
return
False
return
True
def
is_nist_aead_kat_no_ad
(
kat
):
if
len
(
kat
)
!=
16
:
return
False
def
genstr
(
length
):
return
bytes
([
b
%
256
for
b
in
range
(
length
)])
expected_k
=
genstr
(
len
(
kat
[
0
][
3
]))
expected_npub
=
genstr
(
len
(
kat
[
0
][
4
]))
expected_i
=
0
expected_ad
=
b
""
for
i
,
m
,
ad
,
k
,
npub
,
c
in
kat
:
expected_m
=
genstr
(
i
-
1
)
expected_i
+=
1
if
not
(
expected_i
==
i
and
expected_m
==
m
and
expected_k
==
k
and
expected_ad
==
ad
and
expected_npub
==
npub
):
return
False
return
True
if
is_nist_aead_kat
(
kat
):
return
"NIST AEAD KAT"
if
is_nist_aead_kat_no_ad
(
kat
):
return
"NIST AEAD KAT NO AD"
return
None
...
...
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