From fb02e93ff66ecd7bc7257d8f76e6cdf88b54bfa9 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Wed, 1 Nov 2023 16:09:37 +0000 Subject: [PATCH] ECDH tests: comment --- test/nist.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/nist.test.js b/test/nist.test.js index 9d584d4..8d9ec0e 100644 --- a/test/nist.test.js +++ b/test/nist.test.js @@ -95,8 +95,9 @@ should('fields', () => { 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 -// 2. Overall our parser is very strict, so we ignore padded (invalid) private keys, etc. +// We don't support ASN.1 encoding of points. For tests we've implemented quick +// 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) { if (test.flags.includes('InvalidAsn')) return; // Ignore invalid ASN if (test.result === 'valid' || test.result === 'acceptable') {