Skip to content

Commit cff7186

Browse files
committed
schemas: lift up common AsnSignatureTestVector def
1 parent ef57e26 commit cff7186

File tree

3 files changed

+49
-83
lines changed

3 files changed

+49
-83
lines changed

schemas/dsa_verify_schema_v1.json

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,53 +33,13 @@
3333
"tests": {
3434
"type": "array",
3535
"items": {
36-
"$ref": "#/definitions/AsnSignatureTestVector"
36+
"$ref": "verify_common.json#/definitions/AsnSignatureTestVector"
3737
}
3838
}
3939
},
4040
"required": ["source"],
4141
"additionalProperties": false
42-
},
43-
"AsnSignatureTestVector": {
44-
"type": "object",
45-
"properties": {
46-
"tcId": {
47-
"type": "integer",
48-
"description": "Identifier of the test case"
49-
},
50-
"comment": {
51-
"type": "string",
52-
"description": "A brief description of the test case"
53-
},
54-
"msg": {
55-
"type": "string",
56-
"format": "HexBytes",
57-
"description": "The message to sign"
58-
},
59-
"sig": {
60-
"type": "string",
61-
"format": "Asn",
62-
"description": "An ASN encoded signature for msg"
63-
},
64-
"result": {
65-
"type": "string",
66-
"description": "Test result",
67-
"enum": [
68-
"valid",
69-
"invalid",
70-
"acceptable"
71-
]
72-
},
73-
"flags": {
74-
"type": "array",
75-
"items": {
76-
"type": "string"
77-
},
78-
"description": "A list of flags"
79-
}
80-
}
81-
},
82-
"additionalProperties": false
42+
}
8343
},
8444
"properties": {
8545
"algorithm": {

schemas/ecdsa_verify_schema_v1.json

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -33,52 +33,12 @@
3333
"tests": {
3434
"type": "array",
3535
"items": {
36-
"$ref": "#/definitions/AsnSignatureTestVector"
36+
"$ref": "verify_common.json#/definitions/AsnSignatureTestVector"
3737
}
3838
}
3939
},
4040
"required": ["source"],
4141
"additionalProperties": false
42-
},
43-
"AsnSignatureTestVector": {
44-
"type": "object",
45-
"properties": {
46-
"tcId": {
47-
"type": "integer",
48-
"description": "Identifier of the test case"
49-
},
50-
"comment": {
51-
"type": "string",
52-
"description": "A brief description of the test case"
53-
},
54-
"msg": {
55-
"type": "string",
56-
"format": "HexBytes",
57-
"description": "The message to sign"
58-
},
59-
"sig": {
60-
"type": "string",
61-
"format": "Asn",
62-
"description": "An ASN encoded signature for msg"
63-
},
64-
"result": {
65-
"type": "string",
66-
"description": "Test result",
67-
"enum": [
68-
"valid",
69-
"invalid",
70-
"acceptable"
71-
]
72-
},
73-
"flags": {
74-
"type": "array",
75-
"items": {
76-
"type": "string"
77-
},
78-
"description": "A list of flags"
79-
}
80-
},
81-
"additionalProperties": false
8242
}
8343
},
8444
"properties": {

schemas/verify_common.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"definitions": {
4+
"AsnSignatureTestVector": {
5+
"type": "object",
6+
"properties": {
7+
"tcId": {
8+
"type": "integer",
9+
"description": "Identifier of the test case"
10+
},
11+
"comment": {
12+
"type": "string",
13+
"description": "A brief description of the test case"
14+
},
15+
"msg": {
16+
"type": "string",
17+
"format": "HexBytes",
18+
"description": "The message to sign"
19+
},
20+
"sig": {
21+
"type": "string",
22+
"format": "Asn",
23+
"description": "An ASN encoded signature for msg"
24+
},
25+
"result": {
26+
"type": "string",
27+
"description": "Test result",
28+
"enum": [
29+
"valid",
30+
"invalid",
31+
"acceptable"
32+
]
33+
},
34+
"flags": {
35+
"type": "array",
36+
"items": {
37+
"type": "string"
38+
},
39+
"description": "A list of flags"
40+
}
41+
},
42+
"additionalProperties": false,
43+
"required": [ "tcId", "comment", "msg", "sig", "result", "flags"]
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)