Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ML-DSA test vectors. #112

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions schemas/mldsa_sign_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"type": "object",
"definitions": {
"MlDsaSignTestGroup": {
"type": "object",
"properties": {
"type": {
"enum": ["MlDsaSign"]
},
"privateKey": {
"type": "string",
"format": "HexBytes",
"description": "Encoded ML-DSA private key"
},
"tests": {
"type": "array",
"items": {
"$ref": "#/definitions/MlDsaSignTestVector"
}
}
}
}
},
"MlDsaSignTestVector": {
"type": "object",
"properties": {
"tcId": {
"type": "integer",
"description": "Identifier of the test case"
},
"comment": {
"type": "string",
"description": "A brief description of the test case"
},
"msg": {
"type": "string",
"format": "HexBytes",
"description": "The message to sign"
},
"ctx": {
"type": "string",
"format": "HexBytes",
"description": "[optional] The additional context string (empty if not provided)"
},
"sig": {
"type": "string",
"format": "HexBytes",
"description": "The encoded signature (empty in case of failure)"
},
"result": {
"type": "string",
"description": "Test result",
"enum": ["valid", "invalid"]
},
"flags": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of flags"
}
}
},
"properties": {
"algorithm": {
"type": "string",
"description": "the primitive tested in the test file"
},
"generatorVersion": {
"type": "string",
"description": "the version of the test vectors."
},
"header": {
"type": "array",
"items": {
"type": "string"
},
"description": "additional documentation"
},
"notes": {
"type": "object",
"description": "a description of the labels used in the test vectors"
},
"numberOfTests": {
"type": "integer",
"description": "the number of test vectors in this test"
},
"schema": {
"enum": ["ml_dsa_sign_schema.json"]
},
"testGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/MlDsaSignTestGroup"
}
}
}
}
98 changes: 98 additions & 0 deletions schemas/mldsa_verify_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"type": "object",
"definitions": {
"MlDsaVerifyTestGroup": {
"type": "object",
"properties": {
"type": {
"enum": ["MlDsaVerify"]
},
"public_key": {
"type": "string",
"format": "HexBytes",
"description": "Encoded ML-DSA public key"
},
"tests": {
"type": "array",
"items": {
"$ref": "#/definitions/MlDsaVerifyTestVector"
}
}
}
}
},
"MlDsaVerifyTestVector": {
"type": "object",
"properties": {
"tcId": {
"type": "integer",
"description": "Identifier of the test case"
},
"comment": {
"type": "string",
"description": "A brief description of the test case"
},
"msg": {
"type": "string",
"format": "HexBytes",
"description": "The message to verify"
},
"ctx": {
"type": "string",
"format": "HexBytes",
"description": "[optional] The additional context string (empty if not provided)"
},
"sig": {
"type": "string",
"format": "HexBytes",
"description": "The encoded signature"
},
"result": {
"type": "string",
"description": "Test result",
"enum": ["valid", "invalid"]
},
"flags": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of flags"
}
}
},
"properties": {
"algorithm": {
"type": "string",
"description": "the primitive tested in the test file"
},
"generatorVersion": {
"type": "string",
"description": "the version of the test vectors."
},
"header": {
"type": "array",
"items": {
"type": "string"
},
"description": "additional documentation"
},
"notes": {
"type": "object",
"description": "a description of the labels used in the test vectors"
},
"numberOfTests": {
"type": "integer",
"description": "the number of test vectors in this test"
},
"schema": {
"enum": ["ml_dsa_verify_schema.json"]
},
"testGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/MlDsaVerifyTestGroup"
}
}
}
}
745 changes: 745 additions & 0 deletions testvectors_v1/mldsa_44_draft_sign_test.json

Large diffs are not rendered by default.

908 changes: 908 additions & 0 deletions testvectors_v1/mldsa_44_draft_verify_test.json

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions testvectors_v1/mldsa_44_round3_sign_test.json

Large diffs are not rendered by default.

946 changes: 946 additions & 0 deletions testvectors_v1/mldsa_44_round3_verify_test.json

Large diffs are not rendered by default.

837 changes: 837 additions & 0 deletions testvectors_v1/mldsa_44_standard_sign_test.json

Large diffs are not rendered by default.

1,006 changes: 1,006 additions & 0 deletions testvectors_v1/mldsa_44_standard_verify_test.json

Large diffs are not rendered by default.

Loading