Skip to content

Commit 0bdd4f8

Browse files
committed
convert aes_siv_cmac_test to v1 format
This is v0 coverage to augment existing coverage. Unlike the aead_test_schema_v1 schema, and aead_aes_siv_cmac_test.json vectors the aes_siv_cmac_test.json vectors do not provide separated iv/tag data. The daead_test_schema is almost identical to the aead_test_schema but omits ivSize/tagSize in test group, and iv/tag in test vectors. To convert the v0 schema to v1 we only need to adjust the notes ref'd by the flags to the structured v1 format. The EdgeCaseSiv flag is described equivalently as in aead_aes_siv_cmac_test.json
1 parent b12994b commit 0bdd4f8

File tree

2 files changed

+122
-2
lines changed

2 files changed

+122
-2
lines changed

schemas/daead_test_schema_v1.json

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"type": "object",
3+
"definitions": {
4+
"DaeadTestGroup": {
5+
"type": "object",
6+
"properties": {
7+
"type": {
8+
"enum": [
9+
"DaeadTest"
10+
]
11+
},
12+
"source": {
13+
"$ref": "common.json#/definitions/Source"
14+
},
15+
"keySize": {
16+
"type": "integer",
17+
"description": "the keySize in bits"
18+
},
19+
"tests": {
20+
"type": "array",
21+
"items": {
22+
"$ref": "#/definitions/DaeadTestVector"
23+
}
24+
}
25+
},
26+
"required": ["source"],
27+
"additionalProperties": false
28+
},
29+
"DaeadTestVector": {
30+
"type": "object",
31+
"properties": {
32+
"tcId": {
33+
"type": "integer",
34+
"description": "Identifier of the test case"
35+
},
36+
"comment": {
37+
"type": "string",
38+
"description": "A brief description of the test case"
39+
},
40+
"key": {
41+
"type": "string",
42+
"format": "HexBytes",
43+
"description": "the key"
44+
},
45+
"aad": {
46+
"type": "string",
47+
"format": "HexBytes",
48+
"description": "additional authenticated data"
49+
},
50+
"msg": {
51+
"type": "string",
52+
"format": "HexBytes",
53+
"description": "the plaintext"
54+
},
55+
"ct": {
56+
"type": "string",
57+
"format": "HexBytes",
58+
"description": "the ciphertext including tag"
59+
},
60+
"result": {
61+
"type": "string",
62+
"description": "Test result",
63+
"enum": [
64+
"valid",
65+
"invalid",
66+
"acceptable"
67+
]
68+
},
69+
"flags": {
70+
"type": "array",
71+
"items": {
72+
"type": "string"
73+
},
74+
"description": "A list of flags"
75+
}
76+
}
77+
},
78+
"additionalProperties": false
79+
},
80+
"properties": {
81+
"algorithm": {
82+
"type": "string",
83+
"description": "the primitive tested in the test file"
84+
},
85+
"generatorVersion": {
86+
"type": "string",
87+
"description": "DEPRECATED: prefer \"source\" property in test group",
88+
"deprecated": true
89+
},
90+
"header": {
91+
"type": "array",
92+
"items": {
93+
"type": "string"
94+
},
95+
"description": "additional documentation"
96+
},
97+
"notes": {
98+
"$ref": "common.json#/definitions/Notes"
99+
},
100+
"numberOfTests": {
101+
"type": "integer",
102+
"description": "the number of test vectors in this test"
103+
},
104+
"schema": {
105+
"enum": [
106+
"daead_test_schema_v1.json"
107+
]
108+
},
109+
"testGroups": {
110+
"type": "array",
111+
"items": {
112+
"$ref": "#/definitions/DaeadTestGroup"
113+
}
114+
}
115+
},
116+
"additionalProperties": false
117+
}

testvectors_v1/aes_siv_cmac_test.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
"with additional data."
88
],
99
"notes" : {
10-
"EdgeCaseSiv" : "The SIV of this test vector has an edge case value. One purpose of these test vectors is to detect implementations where integer overflows of the counter is incorrectly implemented. AES-SIV itself prevents such overflow problems by clearing some msbs in the IV."
10+
"EdgeCaseSiv" : {
11+
"bugType" : "MISSING_STEP",
12+
"description" : "The SIV of this test vector has an edge case value. One purpose of these test vectors is to detect implementations where integer overflows of the counter is incorrectly implemented. AES-SIV itself prevents such overflow problems by clearing some msbs in the IV."
13+
}
1114
},
12-
"schema" : "daead_test_schema.json",
15+
"schema" : "daead_test_schema_v1.json",
1316
"testGroups" : [
1417
{
1518
"keySize" : 256,

0 commit comments

Comments
 (0)