ECDH tests: comment

This commit is contained in:
Paul Miller 2023-11-01 16:09:37 +00:00
parent c525356916
commit fb02e93ff6
No known key found for this signature in database
GPG Key ID: 697079DA6878B89B

@ -95,8 +95,9 @@ should('fields', () => {
for (const n in vectors) deepStrictEqual(NIST[n].CURVE.Fp.ORDER, vectors[n]); for (const n in vectors) deepStrictEqual(NIST[n].CURVE.Fp.ORDER, vectors[n]);
}); });
// 1. We don't support ASN.1 encoding of points, so we ignore these vectors // We don't support ASN.1 encoding of points. For tests we've implemented quick
// 2. Overall our parser is very strict, so we ignore padded (invalid) private keys, etc. // and dirty parser: take X last bytes of ASN.1 encoded sequence.
// If that doesn't work, we ignore such vector.
function verifyECDHVector(test, curve) { function verifyECDHVector(test, curve) {
if (test.flags.includes('InvalidAsn')) return; // Ignore invalid ASN if (test.flags.includes('InvalidAsn')) return; // Ignore invalid ASN
if (test.result === 'valid' || test.result === 'acceptable') { if (test.result === 'valid' || test.result === 'acceptable') {