Skip to content

Commit 77960a2

Browse files
committed
convert all v1 vectors to use common notes schema
Reference the common notes schema from all v1 schemas. Some v1 vectors were sharing a schema with v0, however the notes field structure is not compatible between the two. This worked previously because the schema definition didn't cover the individual note objects. Now that we've tightened the definition, we need to split those shared schemas. Soon we will delete the v0 vectors and associated schema files, so the duplication is temporary.
1 parent 75e5ea5 commit 77960a2

File tree

120 files changed

+1734
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1734
-121
lines changed

schemas/aead_test_schema_v1.json

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

schemas/dsa_p1363_verify_schema_v1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@
100100
"description": "additional documentation"
101101
},
102102
"notes": {
103-
"type": "object",
104-
"description": "a description of the labels used in the test vectors"
103+
"$ref": "common.json#/definitions/Notes"
105104
},
106105
"numberOfTests": {
107106
"type": "integer",

schemas/dsa_verify_schema_v1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@
9999
"description": "additional documentation"
100100
},
101101
"notes": {
102-
"type": "object",
103-
"description": "a description of the labels used in the test vectors"
102+
"$ref": "common.json#/definitions/Notes"
104103
},
105104
"numberOfTests": {
106105
"type": "integer",
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+
"EcdhEcpointTestGroup": {
5+
"type": "object",
6+
"properties": {
7+
"type": {
8+
"enum": [
9+
"EcdhEcpointTest"
10+
]
11+
},
12+
"source": {
13+
"$ref": "common.json#/definitions/Source"
14+
},
15+
"curve": {
16+
"type": "string",
17+
"format": "EcCurve",
18+
"description": "the name of the curve"
19+
},
20+
"encoding": {
21+
"type": "string",
22+
"description": "the encoding of the public key"
23+
},
24+
"tests": {
25+
"type": "array",
26+
"items": {
27+
"$ref": "#/definitions/EcdhEcpointTestVector"
28+
}
29+
}
30+
},
31+
"required": ["source"],
32+
"additionalProperties": false
33+
},
34+
"EcdhEcpointTestVector": {
35+
"type": "object",
36+
"properties": {
37+
"tcId": {
38+
"type": "integer",
39+
"description": "Identifier of the test case"
40+
},
41+
"comment": {
42+
"type": "string",
43+
"description": "A brief description of the test case"
44+
},
45+
"public": {
46+
"type": "string",
47+
"format": "Asn",
48+
"description": "ASN encoded public point"
49+
},
50+
"private": {
51+
"type": "string",
52+
"format": "BigInt",
53+
"description": "The private exponent"
54+
},
55+
"shared": {
56+
"type": "string",
57+
"format": "HexBytes",
58+
"description": "The shared secret key"
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+
"additionalProperties": false
78+
}
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+
"ecdh_ecpoint_test_schema_v1.json"
107+
]
108+
},
109+
"testGroups": {
110+
"type": "array",
111+
"items": {
112+
"$ref": "#/definitions/EcdhEcpointTestGroup"
113+
}
114+
}
115+
},
116+
"additionalProperties": false
117+
}

schemas/ecdh_pem_test_schema_v1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@
9595
"description": "additional documentation"
9696
},
9797
"notes": {
98-
"type": "object",
99-
"description": "a description of the labels used in the test vectors"
98+
"$ref": "common.json#/definitions/Notes"
10099
},
101100
"numberOfTests": {
102101
"type": "integer",

0 commit comments

Comments
 (0)