Skip to content

Commit 224c8b1

Browse files
authored
schemas: add pbkdf test schema (#232)
1 parent 4d53553 commit 224c8b1

2 files changed

Lines changed: 118 additions & 3 deletions

File tree

schemas/pbkdf_test_schema.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"definitions": {
5+
"PbkdfTestGroup": {
6+
"type": "object",
7+
"properties": {
8+
"type": {
9+
"enum": [
10+
"PbkdfTest"
11+
]
12+
},
13+
"source": {
14+
"$ref": "common.json#/definitions/Source"
15+
},
16+
"tests": {
17+
"type": "array",
18+
"items": {
19+
"$ref": "#/definitions/PbkdfTestVector"
20+
}
21+
}
22+
},
23+
"required": ["type", "tests"],
24+
"additionalProperties": false
25+
},
26+
"PbkdfTestVector": {
27+
"type": "object",
28+
"properties": {
29+
"tcId": {
30+
"type": "integer",
31+
"description": "Identifier of the test case"
32+
},
33+
"comment": {
34+
"type": "string",
35+
"description": "A brief description of the test case"
36+
},
37+
"flags": {
38+
"type": "array",
39+
"items": {
40+
"type": "string"
41+
},
42+
"description": "A list of flags"
43+
},
44+
"password": {
45+
"type": "string",
46+
"format": "HexBytes",
47+
"description": "The password as a hex-encoded byte string"
48+
},
49+
"salt": {
50+
"type": "string",
51+
"format": "HexBytes",
52+
"description": "The salt for the key derivation"
53+
},
54+
"iterationCount": {
55+
"type": "integer",
56+
"description": "The number of iterations for the key derivation"
57+
},
58+
"dkLen": {
59+
"type": "integer",
60+
"description": "The length of the derived key in bytes"
61+
},
62+
"dk": {
63+
"type": "string",
64+
"format": "HexBytes",
65+
"description": "The derived key"
66+
},
67+
"result": {
68+
"$ref": "common.json#/definitions/Result"
69+
}
70+
},
71+
"required": ["tcId", "comment", "flags", "password", "salt", "iterationCount", "dkLen", "dk", "result"],
72+
"additionalProperties": false
73+
}
74+
},
75+
"properties": {
76+
"algorithm": {
77+
"enum": [
78+
"PBKDF2-HMACSHA1",
79+
"PBKDF2-HMACSHA224",
80+
"PBKDF2-HMACSHA256",
81+
"PBKDF2-HMACSHA384",
82+
"PBKDF2-HMACSHA512"
83+
]
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+
"pbkdf_test_schema.json"
107+
]
108+
},
109+
"testGroups": {
110+
"type": "array",
111+
"items": {
112+
"$ref": "#/definitions/PbkdfTestGroup"
113+
}
114+
}
115+
},
116+
"required": ["algorithm", "header", "notes", "numberOfTests", "schema", "testGroups"],
117+
"additionalProperties": false
118+
}

tools/vectorlint/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ var (
7878
// testvectors_v1/pbes2_hmacsha*_aes_*_test.json:
7979
"pbe_test_schema.json": true,
8080

81-
// testvectors_v1/pbkdf2_hmacsha*_test.json:
82-
"pbkdf_test_schema.json": true,
83-
8481
// testvectors_v1/rsa_pss_*_sha*_mgf*_params_test.json
8582
// testvectors_v1/rsa_pss_misc_params_test.json:
8683
"rsassa_pss_with_parameters_verify_schema.json": true,

0 commit comments

Comments
 (0)