Adding test vectors for RSA PKCS #1 v 1.5.

The test vectors replace the previous test for padding oracles, which
had to generate a new key. The test vectors add some new
test cases that are edge cases for the modular exponentiation.

NOKEYCHECK=True
PiperOrigin-RevId: 236813461
GitOrigin-RevId: a92ab2a6af48d3285735fbf5c8ecb66c0750f46b
This commit is contained in:
bleichen
2019-03-05 02:30:27 -08:00
committed by Tink Team
parent 4cd199592b
commit 3255146de3
5 changed files with 4345 additions and 137 deletions
+125
View File
@@ -0,0 +1,125 @@
{
"type": "object",
"definitions": {
"RsaesPkcs1TestGroup": {
"type": "object",
"properties": {
"type": {
"enum": [
"RsaesPkcs1Decrypt"
]
},
"d": {
"type": "string",
"format": "BigInt",
"description": "The private exponent"
},
"e": {
"type": "string",
"format": "BigInt",
"description": "The public exponent"
},
"n": {
"type": "string",
"format": "BigInt",
"description": "The modulus of the key"
},
"privateKeyJwk": {
"type": "object",
"description": "JWK encoded private key"
},
"privateKeyPem": {
"type": "string",
"format": "Pem",
"description": "Pem encoded private key"
},
"privateKeyPkcs8": {
"type": "string",
"format": "Der",
"description": "Pkcs 8 encoded private key."
},
"tests": {
"type": "array",
"items": {
"$ref": "#/definitions/RsaesPkcs1TestVector"
}
}
}
},
"RsaesPkcs1TestVector": {
"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 encrypted message"
},
"ct": {
"type": "string",
"format": "HexBytes",
"description": "An encryption of msg"
},
"result": {
"type": "string",
"description": "Test result",
"enum": [
"valid",
"invalid",
"acceptable"
]
},
"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": [
"rsaes_pkcs1_decrypt_schema.json"
]
},
"testGroups": {
"type": "array",
"items": {
"$ref": "#/definitions/RsaesPkcs1TestGroup"
}
}
}
}