From 5031763c8439367ad49ebe54367ec49cc152885b Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Sat, 5 Sep 2026 14:15:11 +0000 Subject: [PATCH 1/2] test: update WPT for WebCryptoAPI to 55ce71bb9d --- .../encap_decap_bits.tentative.https.any.js | 35 +- .../encap_decap_keys.tentative.https.any.js | 35 +- .../encap_decap/hybrid_kem_vectors.js | 50 ++ .../encap_decap/ml_kem_vectors.js | 682 +----------------- .../generateKey/algorithm_registry.js | 3 + ...failures_Hybrid-KEM.tentative.https.any.js | 6 + .../wpt/WebCryptoAPI/generateKey/successes.js | 35 +- ...uccesses_Hybrid-KEM.tentative.https.any.js | 7 + .../getPublicKey.tentative.https.any.js | 23 +- ...ybrid-KEM_importKey.tentative.https.any.js | 11 + .../Hybrid-KEM_importKey_fixtures.js | 56 ++ .../ML-DSA_importKey_fixtures.js | 6 + .../ML-KEM_importKey_fixtures.js | 6 + .../import_export/ml_importKey.js | 4 +- .../hybridkem.tentative.https.window.js | 32 + .../supports-modern.tentative.https.any.js | 18 + .../fixtures/wpt/WebCryptoAPI/util/helpers.js | 3 + test/fixtures/wpt/versions.json | 2 +- 18 files changed, 307 insertions(+), 707 deletions(-) create mode 100644 test/fixtures/wpt/WebCryptoAPI/encap_decap/hybrid_kem_vectors.js create mode 100644 test/fixtures/wpt/WebCryptoAPI/generateKey/failures_Hybrid-KEM.tentative.https.any.js create mode 100644 test/fixtures/wpt/WebCryptoAPI/generateKey/successes_Hybrid-KEM.tentative.https.any.js create mode 100644 test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey.tentative.https.any.js create mode 100644 test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey_fixtures.js create mode 100644 test/fixtures/wpt/WebCryptoAPI/serialization/hybridkem.tentative.https.window.js diff --git a/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_bits.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_bits.tentative.https.any.js index ffb78f7e5348..c0afb698e0a2 100644 --- a/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_bits.tentative.https.any.js +++ b/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_bits.tentative.https.any.js @@ -1,13 +1,23 @@ -// META: title=WebCryptoAPI: ML-KEM encapsulateBits() and decapsulateBits() tests -// META: script=ml_kem_vectors.js +// META: title=WebCryptoAPI: KEM encapsulateBits() and decapsulateBits() tests // META: script=../util/helpers.js +// META: script=ml_kem_vectors.js +// META: script=hybrid_kem_vectors.js // META: timeout=long function define_bits_tests() { var subtle = self.crypto.subtle; - var variants = ['ML-KEM-512', 'ML-KEM-768', 'ML-KEM-1024']; + var variants = [ + { name: 'ML-KEM-512', ciphertextLength: 768 }, + { name: 'ML-KEM-768', ciphertextLength: 1088 }, + { name: 'ML-KEM-1024', ciphertextLength: 1568 }, + { name: 'MLKEM768-P256', ciphertextLength: 1153 }, + { name: 'MLKEM768-X25519', ciphertextLength: 1120 }, + { name: 'MLKEM1024-P384', ciphertextLength: 1665 }, + ]; + + variants.forEach(function (variant) { + var algorithmName = variant.name; - variants.forEach(function (algorithmName) { // Test encapsulateBits operation promise_test(async function (test) { // Generate a key pair for testing @@ -50,24 +60,11 @@ function define_bits_tests() { 'Shared key should be 32 bytes' ); - // Verify ciphertext length based on algorithm variant - var expectedCiphertextLength; - switch (algorithmName) { - case 'ML-KEM-512': - expectedCiphertextLength = 768; - break; - case 'ML-KEM-768': - expectedCiphertextLength = 1088; - break; - case 'ML-KEM-1024': - expectedCiphertextLength = 1568; - break; - } assert_equals( encapsulatedBits.ciphertext.byteLength, - expectedCiphertextLength, + variant.ciphertextLength, 'Ciphertext should be ' + - expectedCiphertextLength + + variant.ciphertextLength + ' bytes for ' + algorithmName ); diff --git a/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_keys.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_keys.tentative.https.any.js index a482eafbb610..e978fe497e63 100644 --- a/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_keys.tentative.https.any.js +++ b/test/fixtures/wpt/WebCryptoAPI/encap_decap/encap_decap_keys.tentative.https.any.js @@ -1,11 +1,19 @@ -// META: title=WebCryptoAPI: ML-KEM encapsulateKey() and decapsulateKey() tests -// META: script=ml_kem_vectors.js +// META: title=WebCryptoAPI: KEM encapsulateKey() and decapsulateKey() tests // META: script=../util/helpers.js +// META: script=ml_kem_vectors.js +// META: script=hybrid_kem_vectors.js // META: timeout=long function define_key_tests() { var subtle = self.crypto.subtle; - var variants = ['ML-KEM-512', 'ML-KEM-768', 'ML-KEM-1024']; + var variants = [ + { name: 'ML-KEM-512', ciphertextLength: 768 }, + { name: 'ML-KEM-768', ciphertextLength: 1088 }, + { name: 'ML-KEM-1024', ciphertextLength: 1568 }, + { name: 'MLKEM768-P256', ciphertextLength: 1153 }, + { name: 'MLKEM768-X25519', ciphertextLength: 1120 }, + { name: 'MLKEM1024-P384', ciphertextLength: 1665 }, + ]; // Test various 256-bit shared key algorithms var sharedKeyConfigs = [ @@ -36,7 +44,9 @@ function define_key_tests() { }, ]; - variants.forEach(function (algorithmName) { + variants.forEach(function (variant) { + var algorithmName = variant.name; + sharedKeyConfigs.forEach(function (config) { [true, false].forEach(function (extractable) { // Test encapsulateKey operation @@ -115,24 +125,11 @@ function define_key_tests() { ); } - // Verify ciphertext length based on algorithm variant - var expectedCiphertextLength; - switch (algorithmName) { - case 'ML-KEM-512': - expectedCiphertextLength = 768; - break; - case 'ML-KEM-768': - expectedCiphertextLength = 1088; - break; - case 'ML-KEM-1024': - expectedCiphertextLength = 1568; - break; - } assert_equals( encapsulatedKey.ciphertext.byteLength, - expectedCiphertextLength, + variant.ciphertextLength, 'Ciphertext should be ' + - expectedCiphertextLength + + variant.ciphertextLength + ' bytes for ' + algorithmName ); diff --git a/test/fixtures/wpt/WebCryptoAPI/encap_decap/hybrid_kem_vectors.js b/test/fixtures/wpt/WebCryptoAPI/encap_decap/hybrid_kem_vectors.js new file mode 100644 index 000000000000..751d192cbd42 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/encap_decap/hybrid_kem_vectors.js @@ -0,0 +1,50 @@ +// Test vectors from draft-irtf-cfrg-concrete-hybrid-kems-03, Appendix A. + +// MLKEM768-P256 test vectors +ml_kem_vectors['MLKEM768-P256'] = { + publicKey: hexStringToUint8Array( + '3d209f716752f6408e7f89bceef97ac388530045377927644ef046c0a7cae978c8841a0133aac4f1e1a7027277f671219cf58b85d29c8fec08edd432e787a3cf9936fe0026a113cb9efb1d7214049527bfe2141ea170b0294a59403ab0ce16760a8baa95b823cbb8aacdcc17ef32775223c791e3740163941f9bb3f63346bef1c050c31f932c62719429aff14c2bd438ab135bed692d56c77c04cbbffd6335b578318b513771e84b14ea821262141ca006ccb8bf2500aa1008970f216fe7f1ae34125aa290492c069a189222adc322f97649c762c7d3128ad3bb2667971d0744014bc3b67445cbcd0b3e7ea69fb1cb9f9c331f97487920187292926d04a25a2650abbd44982bb0c3c6301fe6a61330d24d8a3c7021dc3e3392c79a139b37613bba67a2984298507b84a4d61eef18acfb979af2d39caa4c0db4513815359d76fc378c63a7f4f3053b17168d0221cf0c2eec5514ba235f81d04d67c3b5c518094917671c26a7c046457533cc32844581277a03eb065c4529a779a9a5878f2aac3f81db9ed3d8c9345697058cbb99d379bca16d8fdb61d129960390524791b9d3e501b900bd1e5002e095be06c23f1fb212f5801f24b6b28c0c5493d246d02aa29fa3acfbe15ac4e212eb0b6f69ebbea259a2703aa4c308224bdb741c65c7a5d4bff788279507bbfe513d7aa5694e7b3cdf62ab36432742d4a0ca9b3570ba742fa803b46989c8526ea586cc4fc32866143b79601725fa545fd280b404530318bbc3371194710b6d74beaa629eb18a36a953b75915ae96999ba5c88cdc56a46861c50032c9b630bcc1445a30878979bc55a2c0955bf399b231203b90c651b6afe0e242b5a543250b142f7291ed753d816098f7913302a8ce91641716623d4fc2ac6772aa5f3674042b7c4a18a2186289a4ac4e200774596ca03e6798c7506b984999db6ac142586bae0799f1e776f9f5247dc574d8556ddf9bbbc4ca3643263457f74248010d62d4311268360aecb4902b450bf2050ecb8ba7a92820d233f5a14ed31225a1d17ca6f19e825894cfb1807d922cbd60761134be419144bcf72006366a4460137ad9136c113f05eb54c409520edc72e4150cc3a24b0f819eec11bbd19ca9645b0810a60b4a8a9e9c3955396a1653955b047bcf4f98433c27236c570d75f809e44aaf2dc33665826351872c293350ab324518c8c0c80b521c80c81a56bdc968a5650315a830c8bb17532c62ccc23b1d46412c256b224fd4674491803501d0143125c7577239689965b6989ca561793c0f85c62a9e13487da17662a7188c70b1040a67ed4c3f85e74e3691822fb96314d6134fe6a626b3cbe1461d62a7b573b2cc75579ffa22967e36ceb2a1aa0b71875a22751d706b72ca9ecd0c8100ad0aa58009a5c83fffe91759e6baa0a9345af99fe3b69509dbc84032868844ab3f65bb1df8beadf36442e48e339c967023a525411544c789a2f04dacd06ffef78302210450b931f6b4c32aab34a3f5260b810f4c9a946fc22d3baabaa80ba8d9955d6dc35e8609b4256b482cdc9d8977c1a47a354e7c527fdb1672e166917b95cd6351820261daab361f8a2dcbb240c55abd6a8105e5291b427b566d731e6b7047189cff20d8b120e0b3e72472d1b0086812200fd3698e23f06e4f4e08bbb54cc2049c039c845be659999c8fa48d7f62327c146cf1bc0b0bb1b91b30174b7bc220d422023bff6b0dee263532c503f3982e4d3e27071b855578a9a9aa63b8a8c339bf' + ), + privateSeed: hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + sampleCiphertext: hexStringToUint8Array( + 'd81018a94f8078e02105beaa814e003390befa4589bb614f77397af42d8e8150796f2c88a4efca81b8cf93c0ae3716c54ec1b045e3875f38c2dd12d7f717bd7fb701a9fecda5ed8b764c9a35d4a5c1d8930f6071f653eebb2d1afa77debb8302d16f17e0f5f3920a71a4d49beafa0e1c7e443f8abca64a65a9e81a97e7357bf902573363c0e1a12e5228036828e3f759121fada92441fe334e85d79347e470d2fed945541d832c54baaa3cb7526c3853954db4f73547cc7c27fd38398bfa7704952cb841e38b270e4db7435f0ee22f57d7ad3270bd0c88e71b4b864cf2277c65daa10a6dad4c7abecd95cc4ebec39c08404b522e4ecc1545713f76bebd3b5a0f2feb3461936065dbd13f6a1f61e1b142a2af2e5a482ba2c50cf0317049c0b3bfd6d5e9240eba9111d2030fdea17e33b6524020d30b0c4f8069285f3a6ca267d287d01e827d8422bf5426e11688bfc73756af1841b1c87e126cb50c914b5b2b8673488ad3b074cad77a3840eb12dd688f313ee1e9ff8c479a678f276356fc9d65e1d5b4c1e9855b4175db144f7767c12061769190fe6b5e51563b91f94d131a2b796bd2980ed0dab4ae7a7110e920007a757158a5eb8662cbf89ddffe9d8196821313cdc00108853fc4746b111d5b56da638d8ed2973918960f5dfe93ead3ae521e957cec3c8d843e8fce234c70ad055177f235439d6098bdd771b1cfcfadaab4f50a7378185c62409f383c8ff658c2a2af66498cfd81e962766ac6b774e88424fb4f331837d0a28502708477caf8780a156d723f68fca791e1cd2397bfc2b24c77c765d9b2af36f732d52107517efd8157b283b440a613f756c364ca108971a8878199a93f260baec3e850033cc032c2e53f823576affb4d3b116e2d16049152c35aaa263ab376f0ad5ede6a749607a283e3016e62191c0e8fde33e718cd989591c9a205d608d99fcb8a7471603d716cb01b56328d7d880aec2851f4e6d8b5016c25647e9026ebb441543e8012dbfcf078d4012b8c39184dd64f3821b4774ae4e36365f8baf2bd1f6667c017a1e65ff8a1554458fb3f367c02721752bfa56fc7fd566ae95ffb208f919ef12f4cf8a2fdd141a8df559bddb7b8d1f04ee6d4cf7805d142989caf216dfae985faaab9974f6d9f8aa1129084db8db912b1655f595ffbaa66491ab4655fd734cfd4bb0c0289d4bcc8fc5e9943b351cb147c8db059a24004d1c3e3bb4c14a881e5101acb736c65c5d579acb67ee85a560277b43338fe79d34b772c5da001da3b5a3383dd81319a0b4542e6d7e46eed5314cc70eb231de27b6e760db598ba19995cf69be0e4458e35f3f274aca2455d43fe3344e183c6dc47c857dbe9907b41e41006d91b25adcafc098fe66f7554be8dad493c4f4b1dbf7a51464139db474afab5572f92a2232b59be56a72c0505149dae5cde1e602877037de7802b5f6fa47a4c9a3e52d6ca15339920254e9ffb53c7b834cc0288ed9905a1841e9390ea94a8898bd4c6b6d6027e4d43c7867242515bbeefe12340fc04428a824ea7cf56ad2a64ed368b71315d80cee846007cff1d2eea2c3f0f921537304ae598f98dd10d1f102811a4e2d161c3fd8bbb193d4b25bee950ac839c0f9d' + ), + expectedSharedSecret: hexStringToUint8Array( + '9bd018e869bb01b63fb8f5da374a73d347ea14cb2bc570b13d0908e2288ec456' + ), +}; + +// MLKEM768-X25519 test vectors +ml_kem_vectors['MLKEM768-X25519'] = { + publicKey: hexStringToUint8Array( + '3d209f716752f6408e7f89bceef97ac388530045377927644ef046c0a7cae978c8841a0133aac4f1e1a7027277f671219cf58b85d29c8fec08edd432e787a3cf9936fe0026a113cb9efb1d7214049527bfe2141ea170b0294a59403ab0ce16760a8baa95b823cbb8aacdcc17ef32775223c791e3740163941f9bb3f63346bef1c050c31f932c62719429aff14c2bd438ab135bed692d56c77c04cbbffd6335b578318b513771e84b14ea821262141ca006ccb8bf2500aa1008970f216fe7f1ae34125aa290492c069a189222adc322f97649c762c7d3128ad3bb2667971d0744014bc3b67445cbcd0b3e7ea69fb1cb9f9c331f97487920187292926d04a25a2650abbd44982bb0c3c6301fe6a61330d24d8a3c7021dc3e3392c79a139b37613bba67a2984298507b84a4d61eef18acfb979af2d39caa4c0db4513815359d76fc378c63a7f4f3053b17168d0221cf0c2eec5514ba235f81d04d67c3b5c518094917671c26a7c046457533cc32844581277a03eb065c4529a779a9a5878f2aac3f81db9ed3d8c9345697058cbb99d379bca16d8fdb61d129960390524791b9d3e501b900bd1e5002e095be06c23f1fb212f5801f24b6b28c0c5493d246d02aa29fa3acfbe15ac4e212eb0b6f69ebbea259a2703aa4c308224bdb741c65c7a5d4bff788279507bbfe513d7aa5694e7b3cdf62ab36432742d4a0ca9b3570ba742fa803b46989c8526ea586cc4fc32866143b79601725fa545fd280b404530318bbc3371194710b6d74beaa629eb18a36a953b75915ae96999ba5c88cdc56a46861c50032c9b630bcc1445a30878979bc55a2c0955bf399b231203b90c651b6afe0e242b5a543250b142f7291ed753d816098f7913302a8ce91641716623d4fc2ac6772aa5f3674042b7c4a18a2186289a4ac4e200774596ca03e6798c7506b984999db6ac142586bae0799f1e776f9f5247dc574d8556ddf9bbbc4ca3643263457f74248010d62d4311268360aecb4902b450bf2050ecb8ba7a92820d233f5a14ed31225a1d17ca6f19e825894cfb1807d922cbd60761134be419144bcf72006366a4460137ad9136c113f05eb54c409520edc72e4150cc3a24b0f819eec11bbd19ca9645b0810a60b4a8a9e9c3955396a1653955b047bcf4f98433c27236c570d75f809e44aaf2dc33665826351872c293350ab324518c8c0c80b521c80c81a56bdc968a5650315a830c8bb17532c62ccc23b1d46412c256b224fd4674491803501d0143125c7577239689965b6989ca561793c0f85c62a9e13487da17662a7188c70b1040a67ed4c3f85e74e3691822fb96314d6134fe6a626b3cbe1461d62a7b573b2cc75579ffa22967e36ceb2a1aa0b71875a22751d706b72ca9ecd0c8100ad0aa58009a5c83fffe91759e6baa0a9345af99fe3b69509dbc84032868844ab3f65bb1df8beadf36442e48e339c967023a525411544c789a2f04dacd06ffef78302210450b931f6b4c32aab34a3f5260b810f4c9a946fc22d3baabaa80ba8d9955d6dc35e8609b4256b482cdc9d8977c1a47a354e7c527fdb1672e166917b95cd6351820261daab361f8a2dcbb240c55abd6a8105e5291b427b566d731e6b7047189cff20d8b120e0b3e72472d1b0086812200fd3698e23f06e4f4e08bbb54cc2f63601b7f85accfeea2d17964c66b5194b0f08e18519faaee194e3c102823062' + ), + privateSeed: hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + sampleCiphertext: hexStringToUint8Array( + 'd81018a94f8078e02105beaa814e003390befa4589bb614f77397af42d8e8150796f2c88a4efca81b8cf93c0ae3716c54ec1b045e3875f38c2dd12d7f717bd7fb701a9fecda5ed8b764c9a35d4a5c1d8930f6071f653eebb2d1afa77debb8302d16f17e0f5f3920a71a4d49beafa0e1c7e443f8abca64a65a9e81a97e7357bf902573363c0e1a12e5228036828e3f759121fada92441fe334e85d79347e470d2fed945541d832c54baaa3cb7526c3853954db4f73547cc7c27fd38398bfa7704952cb841e38b270e4db7435f0ee22f57d7ad3270bd0c88e71b4b864cf2277c65daa10a6dad4c7abecd95cc4ebec39c08404b522e4ecc1545713f76bebd3b5a0f2feb3461936065dbd13f6a1f61e1b142a2af2e5a482ba2c50cf0317049c0b3bfd6d5e9240eba9111d2030fdea17e33b6524020d30b0c4f8069285f3a6ca267d287d01e827d8422bf5426e11688bfc73756af1841b1c87e126cb50c914b5b2b8673488ad3b074cad77a3840eb12dd688f313ee1e9ff8c479a678f276356fc9d65e1d5b4c1e9855b4175db144f7767c12061769190fe6b5e51563b91f94d131a2b796bd2980ed0dab4ae7a7110e920007a757158a5eb8662cbf89ddffe9d8196821313cdc00108853fc4746b111d5b56da638d8ed2973918960f5dfe93ead3ae521e957cec3c8d843e8fce234c70ad055177f235439d6098bdd771b1cfcfadaab4f50a7378185c62409f383c8ff658c2a2af66498cfd81e962766ac6b774e88424fb4f331837d0a28502708477caf8780a156d723f68fca791e1cd2397bfc2b24c77c765d9b2af36f732d52107517efd8157b283b440a613f756c364ca108971a8878199a93f260baec3e850033cc032c2e53f823576affb4d3b116e2d16049152c35aaa263ab376f0ad5ede6a749607a283e3016e62191c0e8fde33e718cd989591c9a205d608d99fcb8a7471603d716cb01b56328d7d880aec2851f4e6d8b5016c25647e9026ebb441543e8012dbfcf078d4012b8c39184dd64f3821b4774ae4e36365f8baf2bd1f6667c017a1e65ff8a1554458fb3f367c02721752bfa56fc7fd566ae95ffb208f919ef12f4cf8a2fdd141a8df559bddb7b8d1f04ee6d4cf7805d142989caf216dfae985faaab9974f6d9f8aa1129084db8db912b1655f595ffbaa66491ab4655fd734cfd4bb0c0289d4bcc8fc5e9943b351cb147c8db059a24004d1c3e3bb4c14a881e5101acb736c65c5d579acb67ee85a560277b43338fe79d34b772c5da001da3b5a3383dd81319a0b4542e6d7e46eed5314cc70eb231de27b6e760db598ba19995cf69be0e4458e35f3f274aca2455d43fe3344e183c6dc47c857dbe9907b41e41006d91b25adcafc098fe66f7554be8dad493c4f4b1dbf7a51464139db474afab5572f92a2232b59be56a72c0505149dae5cde1e602877037de7802b5f6fa47a4c9a3e52d6ca15339920254e9ffb53c7b834cc0288ed9905a1841e9390ea94a8898bd4c6b6d6027e4d43c7867242515bbeefe12340fc6b3d57762f8badb69433f9c6d060f85f5e5c6b6803a816d141c075f63541ad10' + ), + expectedSharedSecret: hexStringToUint8Array( + 'e5ba94031ea6efd69c09c254f6d9783136ba6037e2d4c43bcccf19d6f3f4343a' + ), +}; + +// MLKEM1024-P384 test vectors +ml_kem_vectors['MLKEM1024-P384'] = { + publicKey: hexStringToUint8Array( + 'a10bc8b554cd51980cdbbccc3041420fd320fe8b74c7a84278c63c17070dc231b61ab269b9d677d920261186654b4571f51797d5c342b8070bc6c92bca16adecc631e4e94c7508b111730c749c73e2d6a6f97155cb269ccc06a71a21bef3d269463c935048a7f4636c7b320073709023f7b04d0530571a9a6f718280870bb63875d3f599bc229b95869cd5bb5d26640856d40b828198fdf2c099998ffdf772e462336c521cd326b5e4997bd95c135c57bd02c7afa80a2923d510951778ee5125b2aa18f90445453b85789224725b259279698ac9426c882baabc38d4fb3a3f6831180918b9825e0e418154d78aebab5e7e7066e69b2567476bf1177fe079a38298be6f01b098c33851ab25312b52e32a5750c2b73d293c0b810473b310aaf062f19914c7377b2e90388f575bf5e6853453b95a74aa18d62d4ae37e6996a48ab5217488a92d7b01e315c50b68204143792afc4f8367c0ce065ab32014bdb5515fe0594608aad1218994724afaaaa2df0355f46666b6e02a387b6d3da4713edb610bb048c3a2078b800e9ea483f2009c96d24c71b2cbc8e1200c0277383c5c27895e298c3607701ce58702a91903274a041408234cb0021ef2b1c5131419b444dc84b89d147d1fe43c43f676d906735d9ca2a59c2232d97fd4aa1ae2bb3d1b170ca553cb2574954fdc6689fac623cbaa31982d82424d5a564fef7a8ba51b44df15053b2b45bec4aa1ed49929123daf754175c5938258c608b24d062042ab4bbee5e553a5ea627521738ae5ab2e06bd98b020787b2f5fa51eb4c46c2bf90e55a49560340667f88ac41432b7f551dfd98c037c79f79b41b985a8b1f51345550cd816714362040778c43e378a288394bd028c8c31b5a904bc4a5648a596035cb38f0e276e12c9a96f8425056b05a136642dd2cb75463036485ba1a50539e420e1e31dfac529cad6c68ec06746749473e050a4ac92b7199beceb239b6c12c8e716b66607aeca64a5850b01f99d0b176a7759781ed77cb1ba40d17ac5c6cb06c942c002c2cf6efcb121f10ad2a45ff781426e7104cbdca73b81865ab22b00ba834355ae485a262f354248932c2be178369a3dd7e2428fdc379346ab2b754c43db657460cb09c5c48b5810cb7a5c6156cf87440c9e36a4869a8ac458b382fc178915a9ce1bcdda7c48807c207e656ffb80bf33e32bc8c7b20ef60572612ceac99ad1c56ce5a764b29b74c17a5b510b1afcb18a1afc35c12ac213725325f9b7a2eb338fe4c0080c31a58a995db7027d900e78544887f90ada467d0e383c119c5399310bc6735874e8804ff6c2bae57f2c3357cb627033c12a5924b20ce5abf113172bd2b77086cac543811793bba71734c9f005ac2656460bc30a442b388725758a623e37ba6e293abfb84f344229f373c214ca776a7c05adc465fed93b9cf77f0022ab71f1adde369dd8f420a58c057c14cc18dc47da7c12b086473eab419652967001c4e42a381c8ba539a875d21a9945133bab9bc1e53a600de77cbfb2aeab6b19ced4c6eaa8998ee6a1577255f7132d80a32d6c0c6ec44c9c4b28699a645bb0bc958e00275077925309519b0824c7000dfa61912ec049063a067d00b059053e508a5bfee63473869c8a8510af898cd7572854f5c38af96f5f97a7372632ea7bb4b6fb831c612af71191ff9806b379bcd43c6059b7b1f953741444af713c155d962722b947aa23a32a89b356a6a7508aad63968c1dea78ff18aac27a89aa7b42b0d7481dd3cc649421e51397782218ac5441760ba51a0328d66b436fec32d7aa4d68e0cad1bc14f7241c903480f809983fc2c30d93138cf63b59bc737ac08192893d039187a811bef3d3209eb7b8d1e05b5b251cef760a210b2732867ab32049ba3c354e3858aee7b71df792924730d8e842e484122b50677b0a306e61cf21b62091da18b937192936a09e5a418cf78b666157dd477af1c36a12320129522840e370941157808782a5335b0ac10d70e1beafd401074b84b9826cc58aad217bae0f419b2da896133272d8f22c6f420fcc738fccc1082fc93c7df0994c6bcf2cc8a29037b6bb2b4bcef4b0ee8caf8506bc5ecba082a56806c1cede0b944338a69a668254c1150ae05030e256b2b67661ba027d97576da613ac8c7c29051f1240b96b0c127e264d5e1dbbfe9561a567d5c9103673b446b3ccea6c5f7f34f09348a5d4a58b0498871dc940ee97b50c0336f9a60c3299f99560ac70657a27befa702265ce590583e04a28326092d3dea2118dd1df5e81d7d3014ec4b5ce67dcb45ef001769dd5d5ada76934d38d740924712bfae672169d8f8744c151346d285fbb653f83aa0f' + ), + privateSeed: hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + sampleCiphertext: hexStringToUint8Array( + 'dc63d18bb9715fb6e3ba71cb439fcd3377a75305cc9b144e6758bf5794a272e6b4a0da33234c0ac1bb5b4e60e4c82eb1fb780d59e4e4616641a0595ba031e3ae69d971dcd5fff14e21731a8e1a221f46c7820d214630b707fa1b0de3a484698f3d49e0a75f1212b8c42d330dd909f15eac0402f19ee77fba9447e1c44304b0d8c371c17c5549fdbdec1e0a2e7be9f577d7a4b5b2618d9ba67ab95a0297cd5c5a13c89cc5a57cbd9a8ae38d66455c9a3d2bc55b498775fee2f6dc224d376d5f526a8354c8ed724f60337e900b85627972383e1fd987d407a8834005814a4fdc94c947e5f3471459288cfb127952b3208f10c914200bbaac5fcebd2bc9e2848492bab17b9288ca8b81d1c2ac9522dcc0b6d5f51e10f3afbb5d65fbf919edef6323c4e92c6b0690c10db25a9182de9e919ea1b3e65ae6150635d5180ebd7d23a2264828bc3ee1fd34dba1924ad0db30c747e05baa9148f1a032769c685e04665fd802a79c4624f69a9198a426eac1b217d903cdacf8844e73365f3a219a700dda27edf6bea33602617c5fd105b301b884bfaaa1163b791ec09f82523fef65c87b75ed063ceb127729b82c8712e1f41b547d095f55ee71f3f8b47a306cb5d9bdd817854c74a42eebf934a1136dea3fbc546ad8ce51b3171913722f08b0261d197590342bfe4108dcb08c62a98610cbfb8d3b2831f56dcac2220e29a5811f38f0824f21a6cbebc64fd89a09b110dffbe03799ffc74fe565c80dbf6a66acd7bfd14cb90acba03405a7982d4c1c68caa75f8b72e4dd6401d7dce4db4f6b820a7886a604b66b4e5b9eea5e5eddc2bca458a25977bd1f02874c5d9daf2baf56b3040f24ce7fe14cc14d61c7960db4decb37d9779c8e36d69a7763066d8c1149312d26887a693dc222daa892dd00cd8f3a558cf605e4c65c011c2e9f0d671ba10af2bb90ee0351ae5078eb7878399ec9eb4ace87a68269618bda12a7aed6fda0385496c5d10ac36b35255f4a31edfa8a2c516b65c63431013ed4909ec7a787a5efb9d3c3887b80ac18a44934b6559bd8a84b18e86fa1b0b9e1d9f92ba495ba5595d82e5095612b79e805154bf428a7071662c7cefb6450165c6f8f6954c37219bff4a49894a8aa37f940a40f4ec942c281e6c47ea408199927a724ff1c7460fc8fd47a98d0c9d4d1f07994d8084f6e084935ad7c2985282fabd5ca13b942e10d35278f4ff4cb1cb96f3c862410e79144a46b4db1a3c3d4d63018ec5c01ca48cb67081482e7d434b4abe5fa3071f2fbb533f745602b0da6183b28e6c5dfa42dab7ae0bbbf7638e106be1bd7312cba399e08c96dbd69a128a2face2d4a02951533a25e82fe63d0aaaa2e8c75150215c93ab06c22f9cab8d1cae7424f8baa09b3260ecfa3c7c8d55a276b4b317f72ec86b1b145a63aca83ef8c1204d8ab0c96ea3f742de39db47020616e139285814f188029ace4587f14cf12b5ed81086d8213cf8cb578341e04e16f519b77ff4c2644a5732639d658d0c4eaf992bd7dbd5011b700a5fa63dc1b24a84a3c80656bab5705dc3a74312c80e8bdb24a7ac6e27bcb8c07ece62c6e5777dd3dc0657181f440c7524d907dd27950bcb252aef7f8cbf453cee3fe3143a665072c787cea76de323aa41537df2f3a40a518a694b918953bde8d57084e32d3b1fdcf9d153e73f02624beaf6ebe23e6828a6a489583494f3cd790fc96bb6f5d8b198402965e2e668e6581e7cf1c8a47a92198388f2b4cd38df660f0ddd48ad126819c4435af3a12c89113d778ac544fd8079cb8aaa97d2ff1b608da574c4dcd87f4979390de3be405f0e47788dd0b01662805079fd73c64e9278c036544add3694c838bfcfb08c8a5efb09549442123eaa59fa30fbb9198105f6be00163bac076193f6721c539714108bbfae167f5db8085c5838618f32a968bbb25c40645a17c17b9bec64aea45832eec5adc25b53e677f67566fbf5ce2d9193a06bd9b477e601d589b25f422defc49105252cd9ca6adcbb36be8a01a8472b4d463f655be14ccff9b0571a2048e31c14b9b23e2d43fafa3f85ece6fd41896cc5c68993dbaa926f285ec94c72887de9564881d735c05f83aa474b3d4cd133a630ac63850771cb5270f6cb7a391170d66af3e4901b6eb0253f3f34ef57d6babd97aa99ce718c3bcb53ff13d4028a0c943bb9681106ce176242cccb75df1d3f8d3706e5b068b042c3154d5e6292581b36499e6b069b9a490aa67f0675390539da8555e6a4e8a35a86fdfea83e1387bf4acc650ec1edae7c99aa3a48306ee1d1a5e513c0c6901f64d0a3ee285de3c11d49f90cd4323dafda14832f0d8b760c0e5a48633c967cfaf' + ), + expectedSharedSecret: hexStringToUint8Array( + '8c028c6ea72a1c59408e2b15dd8fed8008517e861cd2329b159bda1919ea656c' + ), +}; + diff --git a/test/fixtures/wpt/WebCryptoAPI/encap_decap/ml_kem_vectors.js b/test/fixtures/wpt/WebCryptoAPI/encap_decap/ml_kem_vectors.js index 3e04fda6a3b3..a3cd8a2a749e 100644 --- a/test/fixtures/wpt/WebCryptoAPI/encap_decap/ml_kem_vectors.js +++ b/test/fixtures/wpt/WebCryptoAPI/encap_decap/ml_kem_vectors.js @@ -2,658 +2,48 @@ var ml_kem_vectors = {}; // ML-KEM-512 test vectors ml_kem_vectors['ML-KEM-512'] = { - // 800-byte publicKey - publicKey: new Uint8Array([ - 0xce, 0xcb, 0x75, 0x1f, 0x32, 0x67, 0x09, 0xb4, 0x9e, 0x14, 0xca, 0xa4, - 0xbe, 0x30, 0x95, 0xee, 0xe9, 0x85, 0x58, 0x86, 0x2b, 0x83, 0xb9, 0x33, - 0x56, 0x86, 0x4e, 0xad, 0x05, 0xcb, 0x38, 0x26, 0x95, 0x4c, 0xdb, 0xb2, - 0x1d, 0xc4, 0x52, 0x44, 0x60, 0x36, 0xdd, 0x77, 0x82, 0x30, 0x09, 0x4f, - 0xe3, 0xb8, 0x14, 0xc7, 0x99, 0x8f, 0x94, 0x45, 0x82, 0xd3, 0x89, 0xcc, - 0xc7, 0x38, 0x97, 0x4e, 0x39, 0x49, 0x6d, 0xb5, 0x34, 0xd4, 0xdb, 0x78, - 0x4b, 0x65, 0x44, 0x6e, 0xa9, 0xbc, 0x59, 0xe8, 0x96, 0xa3, 0x39, 0xbe, - 0x6c, 0x13, 0x46, 0x3a, 0xb7, 0x4a, 0xe2, 0x02, 0x8a, 0x12, 0x69, 0x5c, - 0x5b, 0x12, 0xc1, 0xc9, 0xd5, 0x70, 0x06, 0x58, 0x19, 0xf6, 0x82, 0x3b, - 0x53, 0x3b, 0x29, 0xbb, 0xc8, 0x93, 0x8b, 0xc0, 0xaa, 0x74, 0x52, 0x77, - 0xe7, 0x33, 0x57, 0xd9, 0x52, 0x5c, 0xec, 0x0c, 0xaf, 0xe1, 0xf0, 0x8a, - 0x1b, 0x9b, 0x11, 0xa2, 0xf8, 0xaa, 0xc1, 0xf5, 0xab, 0xb2, 0xa6, 0xb4, - 0x5f, 0x10, 0x95, 0x69, 0xb2, 0x0c, 0xfe, 0xba, 0xaf, 0x32, 0xb4, 0x90, - 0x64, 0x4c, 0x18, 0x84, 0xd7, 0x7f, 0xe3, 0x88, 0xa1, 0x20, 0xb0, 0x85, - 0x14, 0xc9, 0x6e, 0xeb, 0xb3, 0xbc, 0x0c, 0xd9, 0x77, 0x06, 0x76, 0x9f, - 0x70, 0x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, 0xae, 0xb7, 0xbc, 0x49, 0xc6, 0x5a, 0x78, - 0x3a, 0xb8, 0xc2, 0xd1, 0x69, 0xcc, 0xc0, 0x11, 0x3b, 0x18, 0x26, 0x30, - 0x7e, 0x51, 0xb3, 0xc5, 0x73, 0x07, 0xa6, 0x8a, 0xc3, 0xe6, 0x18, 0xba, - 0x22, 0x39, 0x28, 0xd6, 0x33, 0x61, 0x51, 0x28, 0x92, 0xbf, 0x93, 0xb1, - 0x52, 0x68, 0xae, 0x54, 0xea, 0xc4, 0x4f, 0x62, 0x1d, 0x82, 0x94, 0x39, - 0xe2, 0x98, 0x7c, 0x1b, 0xea, 0x13, 0x26, 0x92, 0x6a, 0xb1, 0x1c, 0x59, - 0x11, 0x47, 0x7c, 0x7b, 0xeb, 0x28, 0x2a, 0xe8, 0x81, 0x0b, 0x55, 0x14, - 0x53, 0x80, 0x28, 0xb8, 0x58, 0x8b, 0x1c, 0xa5, 0x91, 0x4e, 0x55, 0x9e, - 0x68, 0x32, 0x5d, 0x5f, 0x94, 0x87, 0x83, 0x73, 0x3f, 0xfc, 0x8b, 0xb4, - 0x8c, 0xd9, 0x52, 0xf8, 0x74, 0x5f, 0x76, 0xc2, 0x63, 0x9a, 0x87, 0x54, - 0x10, 0x47, 0x1e, 0x83, 0x82, 0x31, 0x6d, 0x22, 0x26, 0x16, 0x32, 0xb1, - 0xa1, 0x78, 0x09, 0xd5, 0x8b, 0xbb, 0x75, 0xd7, 0x8b, 0xa2, 0x99, 0xcf, - 0xde, 0x2a, 0x73, 0x0f, 0x80, 0x91, 0xdc, 0x44, 0xb8, 0xaa, 0x73, 0x69, - 0x55, 0xfa, 0x23, 0xb8, 0x16, 0xb1, 0xd7, 0x78, 0x4d, 0x97, 0xab, 0xcb, - 0x0c, 0xf4, 0xcb, 0xb7, 0xc8, 0x36, 0x4e, 0xf1, 0x2a, 0x82, 0xb0, 0x09, - 0x10, 0x3c, 0x8f, 0x7a, 0x76, 0xc6, 0xac, 0x08, 0x6a, 0xe1, 0x0a, 0x3e, - 0x6b, 0x06, 0x39, 0xcb, 0x35, 0xce, 0x10, 0xc3, 0x1f, 0xaa, 0xaa, 0x26, - 0xfc, 0x22, 0xb9, 0xd5, 0x12, 0xcc, 0xa8, 0x48, 0x0a, 0x61, 0xac, 0x3a, - 0xa1, 0x87, 0xbf, 0xea, 0x79, 0x11, 0x7d, 0xfb, 0xc4, 0xfe, 0x0b, 0x4f, - 0x94, 0x57, 0xd8, 0x7b, 0xa4, 0x91, 0x4e, 0xe5, 0x5a, 0x4b, 0xaa, 0x94, - 0x6e, 0x91, 0x55, 0xe9, 0x9b, 0xae, 0xac, 0xe9, 0x52, 0x2c, 0xc6, 0x4b, - 0xee, 0x7b, 0xd7, 0xfa, 0x45, 0xeb, 0x2f, 0x6b, - ]), - // 64-byte privateSeed - privateSeed: new Uint8Array([ - 0x3e, 0x42, 0x62, 0xca, 0xd1, 0x44, 0x02, 0x6d, 0xe9, 0xbd, 0x35, 0xbf, - 0x20, 0x3f, 0xfb, 0x40, 0x26, 0x3c, 0x8c, 0x76, 0x5d, 0x05, 0xd2, 0xa4, - 0xd0, 0x0a, 0x8a, 0xe9, 0x25, 0x07, 0xd2, 0xd2, 0xc5, 0x60, 0xb8, 0x43, - 0x5a, 0x05, 0x4d, 0x81, 0x6e, 0x5f, 0x25, 0x35, 0xa3, 0xdf, 0x91, 0x83, - 0x3c, 0xca, 0xd2, 0x63, 0xe5, 0x8e, 0x3c, 0x34, 0x55, 0x5c, 0xd8, 0xc5, - 0x73, 0x25, 0xad, 0x9d, - ]), - // 768-byte sampleCiphertext - sampleCiphertext: new Uint8Array([ - 0x0e, 0x48, 0x87, 0x58, 0xdc, 0xd4, 0x55, 0x52, 0x56, 0x5b, 0xec, 0xe5, - 0xb8, 0xbd, 0xa4, 0x52, 0x35, 0x44, 0xde, 0x14, 0xee, 0xd1, 0x3f, 0xec, - 0x29, 0xcf, 0x92, 0x60, 0x16, 0x15, 0x89, 0x13, 0x14, 0x32,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de, 0xaf, 0xa3, 0xf4, 0x18, 0xd7, 0xc3, 0x9d, 0x52, 0x76, - ]), - // 32-byte expectedSharedSecret - expectedSharedSecret: new Uint8Array([ - 0x6b, 0x15, 0xad, 0xd5, 0xb3, 0x66, 0xb2, 0x2c, 0x66, 0x8a, 0x1d, 0x81, - 0x90, 0x1d, 0x2e, 0xe2, 0x11, 0x33, 0x03, 0xb6, 0xaf, 0xa8, 0x2e, 0xaf, - 0x67, 0x64, 0xdb, 0xea, 0xd7, 0x66, 0xb8, 0xfc, - ]), + publicKey: hexStringToUint8Array( + 'cecb751f326709b49e14caa4be3095eee98558862b83b93356864ead05cb3826954cdbb21dc452446036dd778230094fe3b814c7998f944582d389ccc738974e39496db534d4db784b65446ea9bc59e896a339be6c13463ab74ae2028a12695c5b12c1c9d570065819f6823b533b29bbc8938bc0aa745277e73357d9525cec0cafe1f08a1b9b11a2f8aac1f5abb2a6b45f109569b20cfebaaf32b490644c1884d77fe388a120b08514c96eebb3bc0cd97706769f70f04847098abf6282ac002fa01584ab96760bdc4657093bb6979e0af8540bb720722a6cbbb8481fd036f5d364c564c96f4aa6beb24086b3b104e0af5910638b667d7d29b32e93addba05437823858f7cfc69acdaa94ba74902973b88a9b08ce2fb109b2a16d31f10d8bb452a08996b9547849908a61ba0d92f36f467aa5224cb92caa17abc937842a4facf64af4e2811278496daca6e1a9898a5c028ea46a64e56784c5be7ef93960a910d7011e03b17caf42ce3ec213759693320b2c96b22aef8010a3825d60bcc0e9151a0fa43df10ca3a3cc6b6d6bb6a2f6035fe3c02362ae07e5a979286924d05a54c5137b46b3998574a73cc009875dd566beae6b4d47a279f585af8ec57cfca28116a95403fa6e49e7a4111689f2340fe9088e0743a26e06bc6c54b01261766905cfb2785ef5d5c986ecc9d74c66efec5769a92c8a034890300f2b7c7d20a80ffb731ce4192cec021ad9b9ac25dc9946004ccdcca5f4b29581f27eb3e724504ac36e95aeb7bc49c65a783ab8c2d169ccc0113b1826307e51b3c57307a68ac3e618ba223928d63361512892bf93b15268ae54eac44f621d829439e2987c1bea1326926ab11c5911477c7beb282ae8810b5514538028b8588b1ca5914e559e68325d5f948783733ffc8bb48cd952f8745f76c2639a875410471e8382316d22261632b1a17809d58bbb75d78ba299cfde2a730f8091dc44b8aa736955fa23b816b1d7784d97abcb0cf4cbb7c8364ef12a82b009103c8f7a76c6ac086ae10a3e6b0639cb35ce10c31faaaa26fc22b9d512cca8480a61ac3aa187bfea79117dfbc4fe0b4f9457d87ba4914ee55a4baa946e9155e99baeace9522cc64bee7bd7fa45eb2f6b' + ), + privateSeed: hexStringToUint8Array( + '3e4262cad144026de9bd35bf203ffb40263c8c765d05d2a4d00a8ae92507d2d2c560b8435a054d816e5f2535a3df91833ccad263e58e3c34555cd8c57325ad9d' + ), + sampleCiphertext: hexStringToUint8Array( + '0e488758dcd45552565bece5b8bda4523544de14eed13fec29cf926016158913143224db555a2d6d42c2ce30f63b7234b825ab11b6b10bbac19835c23cac07e3b37fed08a1eb886199ee2db95e0135af1c21d375edd0c1346617b66cfcd9cda85a8028da745d9d3653fc5b80c6d29b4cd9b02d6c5ac8e7c027a70258573198bc72404a31de1f443854e7becb3bcf390a6fe7c86c3a0b149e51a5103b2dd84b96d20d1f3b1a5308dd9411fa87754d7d8572ad583627db9aa98d2fe09b6fddca3ca8f94e643b56d92babaf105e52ba7082e334f7b8e4866f45f415a1d46901ba932c298dcdb0e964d18a0b725ad058c2d5ea7213ff7f44afeacf1b6a1029fd93ce50a6b34bf51e8323c7da586006d3c1f78c98ca79ccbcff1c14a0309496bfb4f4bc24402a47912f98005defbc082b96c206dca02c9327d7a4166b9ccfea2c45326a98a1ab84dcac0ea35a2b1a2c401b911cdf27652338e74beafab4d945c3f13ca296507c87f73e348bb443b7fa7ec05fa0e35b9f191ec8bade966092748cda729e25a4cf8d9f8fc06daf4a60f3b98530282eabbf57674d34f96cf537639695357825111e0ca9afc04a789df283b125d9f9f1b55927c93bd48e1bcc62f36e7628ea8bddf448ae0ce298442f1a8c8d31dc23b96832603cf2036fbae96fc0fbd2570aa5d6517cc352dddfa944524a4ca6c5c76db98cc796c8f9cfe392748cb3b22eaf5843457729a7b6a801ca0ca9b4656abc9df0911a3d1a11c85be1f41360e85a47e766dcd99cd0a35f1fa6c0945805c846d2a08655363401ae9886d426c3a15aefd0984d5a128c0318f1818d734f624bc6e73a5d42f81329764c3b5186e7d6872e9e3e22de4faef96ae1a772fa1e8fc195e8601dd5468acb80619c658e06e789fab5fd688f8c08c36ac884135232ce832e68a0c15f0165b84c3882afac0bbe4eef7a42de92174af0f685fe47baf2bc797ced19df1808728ace5786cfc5541719ab0ceba544335c1f02ec8b80dde750749743a8a3b91a8e1d2197956c96a02dc51baded9d8846899dbd4ac557a74c4e7843a4c3431132deafa3f418d7c39d5276' + ), + expectedSharedSecret: hexStringToUint8Array( + '6b15add5b366b22c668a1d81901d2ee2113303b6afa82eaf6764dbead766b8fc' + ), }; // ML-KEM-768 test vectors ml_kem_vectors['ML-KEM-768'] = { - // 1184-byte publicKey - publicKey: new Uint8Array([ - 0x0f, 0x61, 0x02, 0x18, 0x60, 0x7b, 0xac, 0x16, 0x36, 0xd1, 0x2a, 0x24, - 0x50, 0x79, 0x65, 0xbc, 0x4b, 0x6f, 0x39, 0x75, 0x69, 0x9e, 0x24, 0xba, - 0x48, 0x9a, 0xb0, 0x0e, 0xb8, 0xbb, 0x94, 0xc4, 0x16, 0xe0, 0x9b, 0x5b, - 0x3c, 0x22, 0x05, 0xda, 0x71, 0xa4, 0x0a, 0xf3, 0x8b, 0x10, 0x95, 0xb9, - 0x98, 0xb7, 0x34, 0x46, 0x2a, 0x0c, 0xdf, 0x33, 0x7b, 0xe7, 0x85, 0x25, - 0xfb, 0xd9, 0x84, 0x54, 0x7a, 0x98, 0x1e, 0x11, 0x9a, 0x10, 0xa1, 0x9b, - 0xb6, 0x22, 0x21, 0xf7, 0x17, 0x60, 0xf4, 0x71, 0x1b, 0x3d, 0x88, 0x31, - 0x7e, 0xf7, 0x83, 0x84, 0xd5, 0x20, 0x28, 0xa9, 0x49, 0x77, 0xa7, 0x59, - 0x96, 0x10, 0xb3, 0x4b, 0xc3, 0x39, 0x4b, 0x90, 0x9c, 0xcc, 0x3a, 0xbf, - 0x62, 0xfb, 0xc2, 0xcc, 0x66, 0xae, 0xc6, 0x17, 0xcd, 0xc9, 0x09, 0x17, - 0xc1, 0x80, 0xba, 0x14, 0x81, 0x68, 0x64, 0xf5, 0x41, 0xc4, 0x3a, 0x1f, - 0x29, 0x98, 0x77, 0xfa, 0x28, 0x4a, 0xca, 0x65, 0x5b, 0xd5, 0xa7, 0xb5, - 0xda, 0x3b, 0x77, 0xe4, 0x86, 0x96, 0xbf, 0xf7, 0x25, 0x25, 0x10, 0x59, - 0x34, 0x26, 0x9f, 0xef, 0x4c, 0x0b, 0xb4, 0x83, 0xce, 0x3d, 0x8c, 0x12, - 0x6f, 0xa4, 0xc0, 0xe4, 0x4a, 0x18, 0x1f, 0x97, 0x31, 0xbe, 0x18, 0x39, - 0xad, 0x08, 0x95, 0xe2, 0x7b, 0x1b, 0xf2, 0xe5, 0x89, 0xf3, 0x08, 0x60, - 0x6c, 0x50, 0xc5, 0x2d, 0x2c, 0x0c, 0x15, 0x78, 0x58, 0x88, 0x65, 0x5e, - 0x72, 0x18, 0x25, 0xd1, 0xa4, 0xb5, 0x25, 0x65, 0x51, 0x85, 0x59, 0xc3, - 0xf2, 0xa7, 0xb4, 0xb5, 0x86, 0x18, 0xe6, 0xe6, 0x91, 0x49, 0xb0, 0x29, - 0x62, 0x21, 0x73, 0x96, 0x89, 0x7e, 0xb7, 0x42, 0x12, 0xb1, 0x07, 0x0d, - 0x9f, 0xb0, 0x9d, 0x0c, 0xf3, 0x93, 0x75, 0x08, 0x9b, 0xf3, 0x25, 0x1e, - 0xf9, 0x92, 0xb2, 0x55, 0xb1, 0x5b, 0x83, 0xc9, 0xb4, 0x75, 0x15, 0x1b, - 0x93, 0x22, 0x83, 0xfc, 0xd9, 0x43, 0xee, 0x7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0x61, - 0x19, 0xf9, 0x25, 0xe4, 0xdb, 0x6a, 0x4a, 0x37, 0xb2, 0x6e, 0x85, 0xc7, - 0x80, 0x22, 0xb8, 0x95, 0x2b, 0x30, 0x59, 0x98, 0x33, 0xbf, 0x18, 0x96, - 0xba, 0x1a, 0x16, 0xfd, 0xb7, 0x1e, 0x4a, 0x30, 0x31, 0x05, 0x85, 0x00, - 0xc8, 0x5a, 0x05, 0xfd, 0x36, 0xb9, 0x97, 0x41, 0xca, 0xc7, 0x90, 0x24, - 0x3a, 0xf9, 0x4c, 0xfb, 0xe2, 0x5d, 0xec, 0x58, 0x08, 0xfa, 0x43, 0xcf, - 0xc7, 0x92, 0xa9, 0xfc, 0xc1, 0xad, 0xf9, 0x62, 0x07, 0x98, 0x32, 0x89, - 0x70, 0x49, 0xb9, 0x99, 0x9a, 0x71, 0x85, 0x72, 0x88, 0xa0, 0xea, 0x84, - 0x23, 0xe1, 0x7e, 0x1d, 0x50, 0xc8, 0xa5, 0x6a, 0x97, 0xfb, 0xfc, 0x0c, - 0xa4, 0x19, 0x5f, 0xc9, 0xd2, 0x0d, 0x6b, 0x7b, 0xbf, 0x62, 0x55, 0x91, - 0xa6, 0x85, 0x8f, 0x75, 0xca, 0x79, 0x1b, 0x65, 0x57, 0x58, 0x5b, 0x4f, - 0x23, 0x86, 0x8a, 0x38, 0x7a, 0xbd, 0x20, 0x08, 0x51, 0x1c, 0xbb, 0x4b, - 0x68, 0x1c, 0x3f, 0x90, 0x49, 0x9c, 0x53, 0xc1, 0x6e, 0x8a, 0x35, 0x22, - 0x49, 0x58, 0x48, 0xc5, 0x0a, 0x0e, 0x37, 0x92, 0x67, 0xd0, 0xb9, 0xbc, - 0xce, 0x9b, 0x84, 0x6b, 0x34, 0x15, 0xbe, 0x0b, 0xa2, 0xa9, 0x52, 0xc3, - 0x7d, 0xfc, 0x68, 0x10, 0xc4, 0x72, 0x6d, 0x01, 0x97, 0x4e, 0xba, 0x5d, - 0x4c, 0x8a, 0xb5, 0x9a, 0x99, 0xb7, 0x5b, 0x7b, 0x9c, 0x6b, 0x86, 0x6d, - 0xe4, 0xc3, 0x87, 0xed, 0x58, 0x4b, 0xf3, 0x91, 0xb7, 0x0c, 0xa8, 0x7a, - 0x37, 0x47, 0x85, 0x44, 0x03, 0x2e, 0x00, 0xcb, 0xbf, 0xf4, 0xd7, 0x4a, - 0x1b, 0x42, 0x99, 0x1e, 0x72, 0x9c, 0x8c, 0x4b, 0xcb, 0x98, 0x0a, 0x48, - 0x7c, 0x55, 0x4b, 0xb7, 0x55, 0x6a, 0x24, 0x23, 0x83, 0xca, 0xb9, 0x36, - 0x36, 0x63, 0x44, 0xe7, 0xe3, 0x3c, 0x8c, 0x91, 0x6d, 0x64, 0xb4, 0x6e, - 0xc2, 0x99, 0x35, 0xbc, 0xa6, 0x5c, 0x8e, 0xda, 0x3f, 0x67, 0x55, 0x9e, - 0xda, 0xda, 0x07, 0x30, 0x16, 0x44, 0xfb, 0xc4, 0x64, 0x3f, 0x9c, 0x2f, - 0xea, 0x45, 0x19, 0x5d, 0x8c, 0x67, 0xce, 0x56, 0x87, 0xff, 0xd0, 0x64, - 0xd2, 0x82, 0xca, 0x82, 0x3b, 0x44, 0x9f, 0x9b, 0x2e, 0xe5, 0x96, 0x29, - 0x7f, 0xf6, 0xa3, 0x4d, 0x38, 0x54, 0xb5, 0x87, 0xc5, 0x96, 0xe3, 0xbc, - 0x2f, 0x7c, 0x4e, 0x91, 0x33, 0x39, 0xbe, 0xc8, 0x54, 0x35, 0xb7, 0x83, - 0x21, 0xb1, 0x23, 0xa8, 0x93, 0x56, 0x44, 0x41, 0xc5, 0x15, 0xa2, 0x80, - 0x56, 0x31, 0x50, 0xd3, 0xf8, 0x0f, 0xfc, 0x68, 0x86, 0x74, 0x34, 0x61, - 0x59, 0x46, 0x1d, 0x17, 0x6c, 0x77, 0xa4, 0xcc, 0xc0, 0x52, 0x73, 0x57, - 0xc9, 0xd0, 0x0d, 0x17, 0x23, 0x73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, 0x7a, 0x52, - ]), - // 64-byte privateSeed - privateSeed: new Uint8Array([ - 0x46, 0x97, 0x3b, 0x12, 0xa0, 0x54, 0xa8, 0x9f, 0x47, 0xd5, 0x3a, 0xf5, - 0x83, 0xad, 0x94, 0x67, 0x6b, 0xbe, 0x8a, 0xc1, 0x04, 0x6b, 0x07, 0x1d, - 0x66, 0x6f, 0x55, 0x81, 0x3b, 0x68, 0x98, 0xaa, 0xaa, 0xcb, 0x55, 0x59, - 0xd0, 0x07, 0xea, 0x68, 0x14, 0x68, 0x3b, 0x49, 0x9d, 0x8b, 0xe1, 0xa0, - 0xf5, 0xbd, 0xf0, 0x52, 0x7a, 0xd9, 0xdf, 0xa8, 0x66, 0x90, 0x38, 0xfb, - 0x33, 0xbe, 0x26, 0xc5, - ]), - // 1088-byte sampleCiphertext - sampleCiphertext: new Uint8Array([ - 0x1a, 0xd4, 0x01, 0xa3, 0xc4, 0x3e, 0x18, 0xa5, 0x80, 0x8d, 0x49, 0xbc, - 0xfa, 0x19, 0x13, 0x2e, 0x0a, 0x3c, 0x0a, 0x55, 0x13, 0x79, 0x16, 0x9c, - 0x07, 0x70, 0x37, 0x6a, 0x12, 0xd2, 0xdd, 0x49, 0x9e, 0xfb, 0xc8, 0x60, - 0xe5, 0x06, 0x77, 0x07, 0xde, 0x7b, 0xe9, 0xb1, 0x64, 0x18, 0x5a, 0x46, - 0x12, 0xdc, 0x88, 0xef, 0x8c, 0xc7, 0x55, 0xf2, 0x53, 0xfe, 0x90, 0x81, - 0xb9, 0xfb, 0x25, 0x82, 0x7f, 0x2e, 0x31, 0x6a, 0x09, 0xae, 0x62, 0xeb, - 0xf8, 0x5d, 0x97, 0x45, 0x46, 0x93, 0xfb, 0x22, 0x04, 0x22, 0xee, 0xc6, - 0xd3, 0xa1, 0x78, 0x21, 0x84, 0x97, 0x7f, 0xce, 0xd1, 0x95, 0x1a, 0xd0, - 0xa8, 0xb7, 0xea, 0xc8, 0x97, 0xf4, 0xe8, 0xe3, 0xbb, 0x7d, 0x15, 0xfd, - 0x3f, 0x78, 0xed, 0x8d, 0x37, 0xea, 0xd1, 0xa5, 0x4e, 0xbf, 0xa2, 0x30, - 0xaf, 0x95, 0xf3, 0x32, 0x6f, 0xbb, 0x05, 0x57, 0xbc, 0x55, 0x8a, 0x8b, - 0x19, 0x50, 0xd9, 0xe5, 0x46, 0x3a, 0x4d, 0x2c, 0xea, 0xaa, 0x1f, 0x7a, - 0x67, 0xf8, 0xd6, 0x25, 0xc9, 0x86, 0x40, 0xa8, 0x9e, 0xd4, 0xee, 0xc2, - 0xe6, 0x3d, 0x34, 0xc0, 0x6d, 0x7b, 0x31, 0xff, 0xe8, 0x3f, 0x86, 0x1a, - 0x3a, 0x7e, 0x50, 0xfe, 0x64, 0x4b, 0x6b, 0xc7, 0x2e, 0x78, 0xce, 0xb7, - 0x73, 0x83, 0x1d, 0x1d, 0x90, 0x5f, 0x7a, 0x34, 0x08, 0xac, 0xb0, 0x73, - 0xac, 0x81, 0xbf, 0x40, 0xed, 0x37, 0x66, 0xf2, 0x83, 0xa5, 0xbc, 0x07, - 0xd2, 0x06, 0xa8, 0x26, 0x4a, 0xfd, 0xef, 0x77, 0x1a, 0xdc, 0xe3, 0x87, - 0x8f, 0x8d, 0x1d, 0x34, 0x6f, 0x92, 0x92, 0xd6, 0xbb, 0xb8, 0xb9, 0xc6, - 0xcb, 0x8e, 0x85, 0x7e, 0xd0, 0x47, 0x98, 0x52, 0x82, 0x89, 0x35, 0xbb, - 0x68, 0xaa, 0x04, 0x69, 0x82, 0x84, 0x34, 0x06, 0x2a, 0xa5, 0xea, 0x49, - 0x30, 0x7a, 0x80, 0xf1, 0x10, 0xff, 0xc1, 0x43, 0xac, 0x86, 0x44, 0xe5, - 0xaa, 0x3a, 0x74, 0xe5, 0x85, 0x39, 0x86, 0xce, 0x97, 0xa2, 0xe6, 0x99, - 0xad, 0xd9, 0xcb, 0x77, 0x53, 0xa1, 0x98, 0x3d, 0x08, 0xd2, 0x53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, 0x86, 0x01, 0x18, 0x3f, 0x8a, 0x69, 0xbf, 0x54, - 0x7d, 0x5b, 0xe4, 0x9b, 0x7f, 0xae, 0xa3, 0x91, 0xbd, 0x2a, 0x4f, 0x5c, - 0xab, 0x05, 0x76, 0x42, 0x20, 0x5b, 0x55, 0x43, 0x7f, 0x99, 0xcc, 0x81, - 0x14, 0xcc, 0x21, 0xba, 0x9e, 0x9f, 0x16, 0xe8, 0x84, 0x4c, 0xf9, 0xda, - 0xd5, 0x39, 0x31, 0x40, 0x9c, 0xf4, 0xef, 0x6c, 0x6e, 0x65, 0xe7, 0x7f, - 0x21, 0xee, 0x2b, 0x3e, 0x70, 0x92, 0x71, 0x29, 0xa4, 0xb5, 0xd7, 0x80, - 0x44, 0xea, 0x70, 0x31, 0x26, 0x4b, 0xce, 0x6a, - ]), - // 32-byte expectedSharedSecret - expectedSharedSecret: new Uint8Array([ - 0x53, 0x2e, 0x3b, 0x9a, 0xf0, 0x8e, 0x5f, 0x55, 0x28, 0x92, 0x9b, 0x76, - 0x2f, 0xb6, 0xe4, 0xd3, 0x0b, 0x28, 0x86, 0xf0, 0x18, 0xf9, 0x70, 0x78, - 0x41, 0x99, 0xf3, 0x15, 0xe3, 0xf5, 0xcf, 0xc3, - ]), + publicKey: hexStringToUint8Array( + '0f610218607bac1636d12a24507965bc4b6f3975699e24ba489ab00eb8bb94c416e09b5b3c2205da71a40af38b1095b998b734462a0cdf337be78525fbd984547a981e119a10a19bb62221f71760f4711b3d88317ef78384d52028a94977a7599610b34bc3394b909ccc3abf62fbc2cc66aec617cdc90917c180ba14816864f541c43a1f299877fa284aca655bd5a7b5da3b77e48696bff72525105934269fef4c0bb483ce3d8c126fa4c0e44a181f9731be1839ad0895e27b1bf2e589f308606c50c52d2c0c15785888655e721825d1a4b52565518559c3f2a7b4b58618e6e69149b02962217396897eb74212b1070d9fb09d0cf39375089bf3251ef992b255b15b83c9b475151b932283fcd943ee7a2e7cb248dfb8325dc0c70d557131cc696646a231755be20a9cee4415de085df3a41665560a59c15a9560879696c0bb344a2787916cb7773af05c65bb79cdf924751bcb4d8a20ae59a609c158b1419c83649a74e17e69765ad4f528ac66c98119c620a318c8179814c25758432a5cb6734e31a02aa9c8ba1488a11a9cf36929e2128db8766d95b2ab22b1155a2253e4277dc780b010e59a42ea95c6a9a0d6f945d57345e555c9f339808ae00aa5475ec6c4526bb010fcac24475a218a758e62f920567711c038196cd037abb57ad132ad622a2e3e39617cf366a398564f31adb5405ff6a920c5326ec726a397fc11cf79259e4862e6d33948299e55f56893eacd10dc9f899847ac127cb8b5527caa9e8cf4af1bf5c506014c76058b1ed10fa0f609b778aa26cacc3bb03e04b49e99fa7ac0330ef2925538804ebc24530003cf08173a4b5a787bcb3bb06b6b7de17a7ad74bc3125b9fa0cb46550cfdc9a9a8400a8fe51f9f39a28aa2a752c16119f925e4db6a4a37b26e85c78022b8952b30599833bf1896ba1a16fdb71e4a3031058500c85a05fd36b99741cac790243af94cfbe25dec5808fa43cfc792a9fcc1adf962079832897049b9999a71857288a0ea8423e17e1d50c8a56a97fbfc0ca4195fc9d20d6b7bbf625591a6858f75ca791b6557585b4f23868a387abd2008511cbb4b681c3f90499c53c16e8a3522495848c50a0e379267d0b9bcce9b846b3415be0ba2a952c37dfc6810c4726d01974eba5d4c8ab59a99b75b7b9c6b866de4c387ed584bf391b70ca87a37478544032e00cbbff4d74a1b42991e729c8c4bcb980a487c554bb7556a242383cab936366344e7e33c8c916d64b46ec29935bca65c8eda3f67559edada07301644fbc4643f9c2fea45195d8c67ce5687ffd064d282ca823b449f9b2ee596297ff6a34d3854b587c596e3bc2f7c4e913339bec85435b78321b123a893564441c515a280563150d3f80ffc688674346159461d176c77a4ccc0527357c9d00d1723734e78b5b374b2d895b0e08b33e97b2d73a6b994f90e89bcabeac2bee498bb09c4bc03ca2c8e00ce99fa04fb048d864c3bb6e1236e5cac3de30407c3284b2c643fe02c6efa024d96401f1bc463e5bbd9c08c81792dbae510f1b727f3a1b530402b47c6b6dbd5147579938fa972afc46e7426782e26a9c8e2c57045482adc100317173ee51d03f3197a102c9fd7b607351b4ad5b6bde45113d637332a288e4f6bb67e444c323ee8218b5c1d1599b58dde352fd6cd647a52' + ), + privateSeed: hexStringToUint8Array( + '46973b12a054a89f47d53af583ad94676bbe8ac1046b071d666f55813b6898aaaacb5559d007ea6814683b499d8be1a0f5bdf0527ad9dfa8669038fb33be26c5' + ), + sampleCiphertext: hexStringToUint8Array( + '1ad401a3c43e18a5808d49bcfa19132e0a3c0a551379169c0770376a12d2dd499efbc860e5067707de7be9b164185a4612dc88ef8cc755f253fe9081b9fb25827f2e316a09ae62ebf85d97454693fb220422eec6d3a1782184977fced1951ad0a8b7eac897f4e8e3bb7d15fd3f78ed8d37ead1a54ebfa230af95f3326fbb0557bc558a8b1950d9e5463a4d2ceaaa1f7a67f8d625c98640a89ed4eec2e63d34c06d7b31ffe83f861a3a7e50fe644b6bc72e78ceb773831d1d905f7a3408acb073ac81bf40ed3766f283a5bc07d206a8264afdef771adce3878f8d1d346f9292d6bbb8b9c6cb8e857ed0479852828935bb68aa0469828434062aa5ea49307a80f110ffc143ac8644e5aa3a74e5853986ce97a2e699add9cb7753a1983d08d253fd5e25efc8d9f110e2bbf89b31957fe0d3cdf5b1f6256ff88d7aa4ecb6b5f91d6620e2c861dc870a903834b4f1b608ac904043ea5c5c0a1f8ec44f91c51c9a2e5fb879d7dbfb9f948c1917ca607ca103a1bfeaccfad2ef34a8799f39261304d6772938b582a2ea948a2839ffb43dc315d0ae311f1e54294cb6dbc1efa904a666b0a381c8b528d10a562641ead95293b74ecc78c2e64af98ba6388278b5091ef29f8b506e7ea4e2b8591cca6145205efc91f9de7e2860d7e2893c888807be0b765a12a8563ce04fcb99d68510312f774fcccd4c5d0f8764cfb9fffffd67b2dc3ff5b4b47da0665409d3dc4ec4da3e36b991f9f3ea2cc01e347d69256ff7057b201f3e04343b2bc81e67009ea659c120e0c606ed2aebe8a67196481ef3c5301bc173a33c61ed931916d21a0e6d9ae73981dd3eb2a33b33a84ecebfbe42249f54a3d817038ec6c60e8998dc9ebd17b96887bd3c69c7b4547f402f24981f5293e0ce5e7707aaf333b9bd982195afffab10a80d53a9ecca129579d5f5fddd6dc5245640f83cf3bf9ae7f839455a14aeaffc2a177d7a5e93110f74f9ea27ed224df258681753683ae1755ae4a8d616fbae8cc686ea06a31b39df7a563735839aadc4ac05f7f4b9edc6b173576fdcc7ce3072dced29dee8355966db7d25bb2f613ea6e32a7c513cc2474b71b3db7d5f8a64c66f7cbeadf3417d7b7f60f27e23566adb11da10c7049ce129fe55a65ad16f60dfecaa1faa0536c54f66a3a0e41e040010c28b2ce6c5e5c9c093599b1bcb0ddd4d23ef4a6a49136a31d769ecd14ca4dd83e66d90a93ac101948875b784a3940b024e3f8ce2d04542fe6714cbf00539f650005ba58eba04377e3734bfe9ff99b6cabfa08743369e4847e3b15445251a94b64270f618a596ce94e22c1f71e40fd19765498bc21c9a59ab7eb77caee81eafed0de8d5424ee3ceff860eabb3b1381fa5287642ec50ea9ee9578a8b7abc00eb187b158c75669c175d50e300a4e00bae5a5333a75933938601183f8a69bf547d5be49b7faea391bd2a4f5cab057642205b55437f99cc8114cc21ba9e9f16e8844cf9dad53931409cf4ef6c6e65e77f21ee2b3e70927129a4b5d78044ea7031264bce6a' + ), + expectedSharedSecret: hexStringToUint8Array( + '532e3b9af08e5f5528929b762fb6e4d30b2886f018f970784199f315e3f5cfc3' + ), }; // ML-KEM-1024 test vectors ml_kem_vectors['ML-KEM-1024'] = { - // 1568-byte publicKey - publicKey: new Uint8Array([ - 0x51, 0xe6, 0x70, 0x71, 0x69, 0x47, 0x5b, 0x3a, 0x30, 0x8f, 0x01, 0x40, - 0x59, 0x58, 0x3b, 0x83, 0x04, 0xcd, 0x2d, 0x93, 0x68, 0x7e, 0x53, 0x15, - 0x83, 0x46, 0x44, 0x79, 0x35, 0x10, 0xd8, 0xbc, 0xb4, 0x6d, 0x90, 0x53, - 0xaf, 0xe0, 0xcb, 0x91, 0x09, 0x5f, 0x39, 0xac, 0x78, 0x2b, 0x8a, 0x61, - 0x27, 0x81, 0xc9, 0xff, 0x6a, 0x4e, 0xf7, 0xb1, 0x7b, 0xb7, 0x62, 0xc1, - 0x38, 0xb5, 0x43, 0xf4, 0x86, 0x54, 0xe6, 0x79, 0x70, 0x66, 0xec, 0xce, - 0x85, 0xd4, 0x3d, 0x42, 0xe7, 0x93, 0x44, 0x6b, 0x74, 0xe3, 0x49, 0x29, - 0x6b, 0x44, 0x5a, 0xfd, 0x2c, 0x9f, 0x45, 0x64, 0x64, 0x97, 0xd1, 0x08, - 0x3f, 0x32, 0x9b, 0xc5, 0x72, 0x3b, 0x3b, 0x62, 0x56, 0x39, 0x6a, 0x13, - 0x5c, 0x31, 0x03, 0x00, 0x41, 0x1b, 0xfb, 0x17, 0x45, 0x03, 0x50, 0xb7, - 0xe1, 0x80, 0x83, 0x2c, 0x00, 0x38, 0xe2, 0x45, 0x0e, 0x78, 0xf5, 0x18, - 0xee, 0x31, 0x84, 0x42, 0xcc, 0xa1, 0x36, 0xab, 0x93, 0x8e, 0xf8, 0x79, - 0x75, 0x25, 0x8b, 0xf2, 0xcc, 0x51, 0x62, 0xb1, 0xa9, 0x3d, 0x8a, 0x51, - 0xea, 0x52, 0xa1, 0xa8, 0xd4, 0xca, 0x23, 0xb9, 0xb6, 0x0b, 0xd6, 0x8c, - 0x7f, 0x41, 0x86, 0xa9, 0x80, 0x69, 0x99, 0xcc, 0x88, 0x6f, 0xa3, 0x69, - 0x2f, 0xfc, 0xbb, 0x46, 0xaa, 0xa2, 0x8f, 0x85, 0x6f, 0x9a, 0x77, 0x43, - 0x57, 0x40, 0x2f, 0xb0, 0xa5, 0xce, 0x80, 0xf6, 0x96, 0x31, 0xe5, 0x23, - 0x36, 0x72, 0x9e, 0x04, 0x38, 0xa1, 0xe9, 0x3a, 0x21, 0x4a, 0xe9, 0x9f, - 0x15, 0x26, 0x3e, 0xff, 0x13, 0x5d, 0xe0, 0xa9, 0x42, 0xd8, 0xb3, 0xc2, - 0x61, 0xb4, 0x22, 0xc0, 0x34, 0xb1, 0xbe, 0xc7, 0x90, 0x36, 0xb0, 0xa0, - 0x41, 0xc3, 0x7b, 0xe0, 0x33, 0x34, 0xae, 0x42, 0xcf, 0x86, 0x13, 0x28, - 0x3e, 0xe8, 0x0e, 0x69, 0x31, 0x49, 0x89, 0xf3, 0x69, 0x6f, 0x18, 0x25, - 0xbc, 0x53, 0xc8, 0x94, 0x32, 0x3e, 0x17, 0x75, 0xc7, 0x2f, 0x77, 0x94, - 0x15, 0xb8, 0x84, 0x87, 0xec, 0x26, 0xf4, 0xb1, 0x64, 0x46, 0xa0, 0xaa, - 0xb0, 0xe5, 0x22, 0x6b, 0x83, 0x7b, 0x8d, 0x13, 0x29, 0x7e, 0x31, 0xb4, - 0x7b, 0x4b, 0x41, 0xa4, 0x9b, 0x82, 0x3f, 0x69, 0x64, 0xe5, 0x37, 0x8a, - 0x78, 0x06, 0x3a, 0xfa, 0x24, 0xb5, 0xe6, 0x29, 0x4f, 0x27, 0x0b, 0xba, - 0x5a, 0x7b, 0x90, 0xe4, 0x2a, 0x2d, 0x6b, 0xa4, 0x41, 0x9f, 0x85, 0x8a, - 0xdb, 0xb1, 0x8f, 0x90, 0x1c, 0x37, 0xa0, 0xf2, 0x78, 0xbf, 0x6c, 0x46, - 0x8e, 0x72, 0x3f, 0x00, 0xbc, 0xba, 0x37, 0x10, 0x80, 0x9b, 0xd5, 0x5e, - 0x35, 0xbb, 0xb5, 0x20, 0xdc, 0x9f, 0x44, 0x61, 0x46, 0x65, 0x00, 0x6f, - 0x71, 0x3b, 0x5b, 0xa2, 0x64, 0xbb, 0x26, 0xb7, 0x10, 0x6d, 0x89, 0xbb, - 0x71, 0x4c, 0x65, 0xc0, 0xf3, 0x78, 0xdf, 0x16, 0x51, 0xa5, 0x75, 0xcd, - 0x63, 0x77, 0xa2, 0x83, 0x74, 0xb7, 0x66, 0x8b, 0xb6, 0xb1, 0x43, 0x66, - 0x12, 0xa3, 0x9c, 0x71, 0xea, 0xa4, 0x82, 0xeb, 0x78, 0xb7, 0xd0, 0x7d, - 0x49, 0x14, 0x87, 0x3e, 0x36, 0x38, 0x42, 0x90, 0xa7, 0xc4, 0x47, 0x86, - 0xe9, 0xb3, 0x7b, 0x8b, 0x42, 0x78, 0x82, 0x06, 0x9f, 0x0a, 0x90, 0x18, - 0xb4, 0x87, 0xa5, 0xff, 0xa8, 0xbc, 0x83, 0xd5, 0x2a, 0xab, 0x57, 0x95, - 0x63, 0x97, 0xac, 0x60, 0x56, 0x31, 0x3b, 0x94, 0xb5, 0x3c, 0xe1, 0xc3, - 0x9b, 0x71, 0x7e, 0x9b, 0xe2, 0x8b, 0xc7, 0xca, 0x12, 0xc4, 0x93, 0x8e, - 0x48, 0xbb, 0x03, 0x1a, 0x56, 0x39, 0x62, 0xc0, 0x5f, 0x25, 0xa4, 0x06, - 0xda, 0x2b, 0x7c, 0x1b, 0x98, 0x3a, 0x55, 0x5c, 0x5a, 0xe7, 0x93, 0x62, - 0x2c, 0x31, 0x93, 0xc4, 0xc1, 0x75, 0xfe, 0x0a, 0x8d, 0xfe, 0x20, 0xc1, - 0xcb, 0xb9, 0x4d, 0x96, 0x97, 0x16, 0x01, 0x60, 0x87, 0x8c, 0x67, 0x20, - 0xee, 0xf4, 0x4f, 0x8c, 0x22, 0x54, 0x9c, 0xf6, 0x2a, 0x2b, 0x4c, 0xbf, - 0xfc, 0x11, 0x9b, 0xd1, 0xc4, 0x6a, 0x10, 0xd0, 0x66, 0x1d, 0x5c, 0x4b, - 0x1a, 0x92, 0x77, 0xaa, 0x31, 0x00, 0xd8, 0xe3, 0x63, 0x68, 0x99, 0xbe, - 0xe5, 0x43, 0x12, 0x7c, 0xbb, 0x2a, 0x8c, 0x70, 0xb6, 0x76, 0x8c, 0xc5, - 0x1a, 0xa4, 0x39, 0x93, 0x87, 0x25, 0x87, 0x71, 0x87, 0xaa, 0x25, 0x3e, - 0xea, 0x51, 0xc6, 0x78, 0x4c, 0x29, 0xb3, 0x65, 0x07, 0xe4, 0x03, 0x9c, - 0x37, 0xb8, 0x45, 0xee, 0x4b, 0x05, 0x81, 0x55, 0xa3, 0xb8, 0x51, 0xca, - 0x68, 0x5c, 0x05, 0x4f, 0x80, 0x86, 0xca, 0x95, 0x58, 0x24, 0xab, 0x41, - 0x44, 0xc4, 0x36, 0x8d, 0xdc, 0x70, 0x76, 0x4a, 0x18, 0x4c, 0x2a, 0x2a, - 0xbe, 0xcc, 0x84, 0xad, 0xd7, 0x65, 0x07, 0x36, 0xa0, 0xf8, 0x86, 0x5e, - 0xc0, 0xc6, 0xb4, 0xbe, 0x22, 0x34, 0x5c, 0xeb, 0xc6, 0xed, 0x7a, 0x27, - 0xd5, 0x61, 0x61, 0xf3, 0x50, 0xa6, 0x05, 0xeb, 0x4b, 0x3f, 0x18, 0xa6, - 0x85, 0xdb, 0x16, 0x06, 0x35, 0x2e, 0x05, 0x2a, 0x97, 0xe9, 0xa5, 0xcf, - 0xb3, 0xb1, 0xc9, 0x09, 0xf5, 0x54, 0x5c, 0xe0, 0xa4, 0x19, 0xc6, 0x05, - 0xb7, 0x85, 0x94, 0x0f, 0x32, 0xc6, 0x22, 0xe3, 0x17, 0x87, 0xc5, 0xa3, - 0x61, 0xf4, 0x5e, 0xcd, 0xa5, 0x0b, 0x4b, 0x75, 0x46, 0xe7, 0x55, 0xaa, - 0x62, 0x67, 0x9f, 0x13, 0xea, 0xaa, 0x78, 0x75, 0x5f, 0x31, 0x18, 0x99, - 0x1b, 0x0a, 0x57, 0x92, 0x49, 0x59, 0x9a, 0x39, 0x21, 0x47, 0x11, 0x52, - 0x63, 0x4b, 0x4f, 0xe4, 0x01, 0xb1, 0x1c, 0xe7, 0x18, 0x2c, 0x54, 0xa3, - 0x21, 0x89, 0x9a, 0x94, 0xb4, 0x45, 0xb7, 0xca, 0x32, 0xbe, 0x5c, 0x13, - 0x02, 0xf7, 0x7e, 0x51, 0xdc, 0x86, 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, 0xb6, 0x7c, 0x86, - 0x78, 0x27, 0x59, 0xf1, 0xe3, 0xaf, 0xd1, 0x09, 0x4d, 0x66, 0xb6, 0x10, - 0x0d, 0x87, 0x2b, 0x72, 0x54, 0xbd, 0xa0, 0xb1, 0x7b, 0x17, 0xb9, 0xcd, - 0x15, 0x44, 0x50, 0x9f, 0x9a, 0x72, 0xb7, 0x9c, 0x21, 0x96, 0x92, 0x54, - 0x82, 0x3c, 0x50, 0x13, 0x24, 0x4c, 0x68, 0x1a, 0x77, 0x28, 0x29, 0x78, - 0x69, 0xbb, 0x7c, 0xae, 0x71, 0x6f, 0x9d, 0x59, 0x86, 0x8d, 0x0c, 0x2a, - 0xef, 0x98, 0x21, 0x53, 0xe2, 0x18, 0xab, 0x55, 0xb8, 0xce, 0x96, 0x9f, - 0x31, 0x85, 0x26, 0x8a, 0x88, 0x0c, 0x31, 0x98, 0x87, 0x38, 0x58, 0x9d, - 0x42, 0xb8, 0x1b, 0xbc, 0xe5, 0xae, 0xdb, 0x29, 0xb0, 0xe9, 0x93, 0x37, - 0xf2, 0x38, 0x9a, 0xa5, 0x43, 0x50, 0x28, 0x97, 0x42, 0x45, 0x63, 0x84, - 0x66, 0x91, 0x87, 0xd2, 0xc6, 0x91, 0x8c, 0x59, 0x03, 0x3c, 0x92, 0x49, - 0x69, 0xa3, 0x67, 0x51, 0xb1, 0x01, 0x34, 0x54, 0x99, 0x75, 0xb2, 0x77, - 0xaf, 0xd9, 0x03, 0x3f, 0x50, 0xce, 0x65, 0xdc, 0x63, 0x3e, 0x5a, 0x1d, - 0x01, 0xa3, 0xb6, 0x13, 0x8c, 0x6f, 0x01, 0xf7, 0xae, 0xa1, 0x79, 0xc7, - 0xc8, 0xc7, 0x9e, 0x4b, 0xfb, 0x20, 0x3f, 0xd9, 0xb2, 0x8f, 0xa2, 0x3c, - 0x14, 0xe6, 0x55, 0xba, 0x77, 0x91, 0x92, 0x8a, 0xc4, 0x6f, 0xe1, 0xa6, - 0xb8, 0xb9, 0x36, 0x58, 0x09, 0x27, 0x68, 0xe6, 0x5e, 0x85, 0xc5, 0xae, - 0xd9, 0xe8, 0x97, 0xdd, 0x8a, 0x45, 0x71, 0x2a, 0xab, 0xcb, 0x7c, 0x19, - 0x19, 0x07, 0x65, 0x68, 0x49, 0x55, 0x9e, 0xd8, 0x4d, 0x40, 0x77, 0xc1, - 0x14, 0xd9, 0x11, 0xf9, 0xe8, 0x26, 0x70, 0x28, 0xa5, 0x85, 0x6a, 0x90, - 0x23, 0xba, 0x51, 0x08, 0x67, 0x86, 0x68, 0x92, 0x67, 0xa5, 0x6b, 0x06, - 0xe6, 0x28, 0x1f, 0x1b, 0xc3, 0x43, 0x4b, 0x01, 0xbf, 0x96, 0xb0, 0x24, - 0x3e, 0x08, 0x86, 0xd7, 0xf4, 0x37, 0x25, 0xf9, 0xaa, 0x59, 0x8b, 0x51, - 0x5c, 0xea, 0x40, 0x1b, 0x77, 0x51, 0xe1, 0xa2, 0x59, 0x81, 0x65, 0x26, - 0x23, 0x2a, 0x75, 0xd0, 0x72, 0x74, 0xf6, 0xbc, 0x4b, 0xd0, 0xd1, 0xa6, - 0x1e, 0xbb, 0x11, 0x80, 0x4a, 0xa7, 0x9f, 0x09, 0x40, 0x08, 0xe5, 0xa1, - 0x90, 0x85, 0x43, 0x1a, 0xc1, 0x1c, 0x50, 0x8a, 0x6f, 0xbd, 0x50, 0x26, - 0x8a, 0x8c, 0x80, 0x21, 0xc4, 0xb1, 0x9b, 0xfa, 0x56, 0x90, 0x97, 0x20, - 0xbf, 0xb7, 0x26, 0xca, 0xe9, 0xa7, 0xb7, 0x73, 0x6f, 0xaf, 0x17, 0xcf, - 0xba, 0x9b, 0x3b, 0x4a, 0x32, 0xad, 0xbb, 0x04, 0x50, 0xe9, 0x00, 0x24, - 0xbb, 0xe8, 0x2c, 0xdb, 0xb0, 0x2f, 0x62, 0x00, 0x5e, 0xf3, 0x34, 0x79, - 0x8c, 0xb3, 0xbd, 0x7f, 0xda,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 0xb7, 0xd6, 0x86, 0xdf, 0xe7, 0x07, - 0xd7, 0xb9, 0x16, 0xb1, 0xe8, 0xb2, 0x49, 0x50, 0xc7, 0x4b, 0x9b, 0x60, - 0x01, 0x60, 0x4e, 0x5d, 0x33, 0x3a, 0x35, 0x99, 0x2a, 0x7c, 0xc4, 0x4c, - 0xe3, 0xbc, 0x1b, 0xbd, 0xb8, 0xc7, 0x2f, 0x08, 0x42, 0x8d, 0x8a, 0x6e, - 0x59, 0x20, 0x61, 0x9d, 0x81, 0x96, 0xa7, 0xd3, 0x26, 0x95, 0x33, 0xbd, - 0xcd, 0x34, 0x35, 0x18, 0x3b, 0x5d, 0x6e, 0x98, - ]), - // 64-byte privateSeed - privateSeed: new Uint8Array([ - 0xd7, 0x10, 0xa2, 0xbc, 0x47, 0x89, 0x36, 0x8c, 0xf2, 0x0a, 0xf5, 0xfe, - 0xee, 0xdc, 0x8b, 0x9a, 0x8d, 0x0a, 0x88, 0xeb, 0xd7, 0x70, 0xf9, 0x1e, - 0x9a, 0x44, 0x11, 0x46, 0x52, 0x6f, 0x6b, 0x0e, 0x71, 0x1d, 0x94, 0x5a, - 0x87, 0x86, 0xbd, 0xce, 0x9f, 0x16, 0x7d, 0xdc, 0x5d, 0xa8, 0xc7, 0xab, - 0x96, 0xdc, 0x30, 0x5d, 0x6a, 0x36, 0x63, 0x19, 0xd5, 0xf8, 0xa6, 0x92, - 0x4f, 0x18, 0x39, 0x59, - ]), - // 1568-byte sampleCiphertext - sampleCiphertext: new Uint8Array([ - 0xd5, 0x4d, 0xf4, 0xd6, 0x79, 0x31, 0x4c, 0xfd, 0x6f, 0x32, 0x91, 0xcb, - 0x64, 0x4b, 0x99, 0x73, 0x14, 0x5a, 0x78, 0x8c, 0x98, 0xef, 0x94, 0xe6, - 0x8e, 0x9f, 0x8d, 0x1f, 0x92, 0xeb, 0x84, 0x23, 0x96, 0x84, 0x9e, 0x69, - 0x14, 0xd8, 0xcf, 0x53, 0x09, 0x02, 0x57, 0x88, 0x2f, 0x26, 0xb1, 0xfb, - 0x4c, 0x07, 0xa2, 0xb6, 0xad, 0xea, 0xf3, 0xbd, 0x56, 0x8c, 0x5d, 0x3c, - 0x5b, 0x54, 0x32, 0x0d, 0x95, 0x0f, 0xa5, 0x59, 0x80, 0xaf, 0x8d, 0x96, - 0xfd, 0x7d, 0x49, 0x65, 0x82, 0x5b, 0x63, 0x88, 0x42, 0x92, 0x9f, 0x7b, - 0x6a, 0xcf, 0x5d, 0xfd, 0x30, 0x33, 0xf3, 0xf3, 0x45, 0xaf, 0x31, 0x32, - 0x80, 0xe0, 0x10, 0x5f, 0xaa, 0xdd, 0x42, 0x71, 0x5f, 0xff, 0x55, 0x55, - 0x0c, 0xaa, 0x64, 0x36, 0x89, 0x67, 0xf1, 0x58, 0xca, 0x3a, 0x7d, 0x00, - 0xae, 0xb4, 0xdf, 0x1e, 0xcc, 0xde, 0x24, 0x0f, 0x5b, 0x21, 0x10, 0xef, - 0xe6, 0x5f, 0x58, 0xe9, 0xb3, 0xee, 0x54, 0x98, 0x7e, 0x07, 0xea, 0xe1, - 0x95, 0x27, 0x9a, 0xfa, 0x37, 0x3d, 0x74, 0x62, 0xa4, 0x8d, 0x9c, 0x79, - 0xb7, 0xc8, 0xa3, 0xf8, 0x16, 0x2d, 0x84, 0x30, 0xbd, 0x0d, 0x97, 0xbd, - 0x90, 0x14, 0x36, 0x29, 0x7c, 0x12, 0x3e, 0x41, 0xf7, 0x40, 0x96, 0x06, - 0x54, 0x69, 0xd5, 0x87, 0xb9, 0xe7, 0x42, 0x77, 0x3f, 0xfe, 0xf9, 0x13, - 0x46, 0xe3, 0x51, 0xbb, 0x95, 0xb4, 0x3b, 0x8c, 0x08, 0x2a, 0x28, 0x7b, - 0x97, 0x98, 0x91, 0x17, 0x4e, 0x71, 0x86, 0xdc, 0x8c, 0xf2, 0xd6, 0x4a, - 0x07, 0x71, 0x1f, 0x6e, 0x9f, 0x17, 0xcf, 0x02, 0xad, 0xdc, 0xc3, 0xb8, - 0x03, 0xfd, 0xc2, 0xe3, 0xee, 0xc9, 0xd3, 0x91, 0x84, 0x1f, 0x0b, 0x38, - 0x5e, 0x2d, 0x3e, 0x09, 0x08, 0xab, 0x84, 0x18, 0x82, 0x67, 0xce, 0xdd, - 0xcf, 0xb6, 0x9d, 0x2f, 0x44, 0x4f, 0x69, 0x00, 0x88, 0x16, 0x45, 0x8d, - 0xa4, 0xda, 0xd5, 0x9a, 0x79, 0xe3, 0x37, 0x83, 0x33, 0x9c, 0xcc, 0xeb, - 0x55, 0x24, 0xa0, 0x22, 0x7f, 0x11, 0x4a, 0x23, 0x67, 0xdb, 0xcc, 0x5f, - 0x97, 0x85, 0xef, 0x15, 0x66, 0x5e, 0x92, 0x1e, 0x87, 0x7b, 0x24, 0x05, - 0x87, 0x67, 0x43, 0xec, 0xed, 0x6d, 0x76, 0xaf, 0x9d, 0x4a, 0xa6, 0xa6, - 0x80, 0x33, 0xc2, 0x43, 0x51, 0x58, 0xd7, 0xb0, 0x10, 0x60, 0x58, 0xef, - 0x98, 0x52, 0xa8, 0x1a, 0x46, 0x2b, 0xfb, 0x3c, 0xf8, 0xb1, 0x60, 0x27, - 0xe5, 0xe0, 0x82, 0x50, 0xc1, 0x2c, 0xb1, 0xe4, 0x13, 0x06, 0x68, 0x17, - 0x36, 0x23, 0x35, 0x6f, 0x97, 0x93, 0xdb, 0x05, 0xbd, 0x06, 0x5e, 0xa3, - 0x6a, 0x61, 0x32, 0x6c, 0xca, 0xf5, 0x3d, 0x2e, 0xc0, 0xa1, 0x34, 0xdc, - 0x1f, 0xc6, 0xc7, 0x2a, 0x40, 0x3d, 0x27, 0x46, 0x30, 0xb7, 0x34, 0x64, - 0xaa, 0xa1, 0x6b, 0x46, 0xa7, 0x1c, 0x82, 0xd8, 0xa0, 0x27, 0xcb, 0x50, - 0x05, 0xf2, 0x24, 0x26, 0xc0, 0xb5, 0x31, 0x4b, 0x04, 0xb7, 0x08, 0xd7, - 0xac, 0xa3, 0xf4, 0xb8, 0x53, 0x8e, 0xc1, 0x92, 0x53, 0xf9, 0x40, 0xb4, - 0xb8, 0x15, 0xaf, 0x22, 0xce, 0x82, 0xbd, 0xcd, 0x7d, 0xa8, 0x5a, 0x61, - 0xac, 0x18, 0x7c, 0x92, 0xef, 0x38, 0xc8, 0xc2, 0x99, 0x00, 0x51, 0x91, - 0x64, 0x82, 0x37, 0x47, 0xea, 0xa5, 0xf6, 0x8b, 0xea, 0x24, 0xe8, 0x7e, - 0x62, 0x3c, 0xb7, 0x4d, 0xac, 0x2c, 0x7b, 0x57, 0xfa, 0x1f, 0x28, 0x53, - 0x16, 0xfd, 0x74, 0x4b, 0x83, 0x80, 0x0e, 0xf3, 0x66, 0x36, 0xcd, 0xf5, - 0x29, 0x23, 0x0d, 0xc6, 0x9e, 0x7b, 0xb2, 0x8b, 0xc5, 0xc6, 0x48, 0xdb, - 0x1d, 0xbb, 0x61, 0x48, 0xae, 0x05, 0x10, 0x99, 0x9b, 0x48, 0x23, 0x8c, - 0x10, 0x50, 0xee, 0x5e, 0xa0, 0x49, 0x86, 0x27, 0x4e, 0xfe, 0xa8, 0x63, - 0xde, 0x71, 0xf5, 0x52, 0x8c, 0xef, 0xcc, 0xd3, 0x9e, 0x0e, 0x17, 0x9b, - 0x57, 0x49, 0xb7, 0x27, 0x29, 0x01, 0x3c, 0xbb, 0x1e, 0x85, 0xb9, 0x6a, - 0x13, 0x47, 0x59, 0xd8, 0x0b, 0xca, 0xb2, 0xa5, 0xe4, 0xeb, 0x93, 0xfd, - 0x7e, 0xef, 0x26, 0xae, 0x23, 0xed, 0x1e, 0x07, 0xd5, 0x91, 0x72, 0xa4, - 0x8d, 0x09, 0xae, 0xef, 0xfa, 0xfe, 0x12, 0xad, 0x46, 0xd7, 0x91, 0xbf, - 0xc6, 0xa7, 0x13, 0x30, 0x7d, 0xad, 0x2b, 0x8e, 0xd4, 0x14, 0x87, 0xf2, - 0x89, 0xeb, 0x2c, 0xca, 0xb8, 0x36, 0x12, 0xb0, 0xec, 0x61, 0xc8, 0xdc, - 0x32, 0x80, 0xae, 0x89, 0x9a, 0x4b, 0x57, 0xe2, 0xe1, 0x33, 0xb5, 0xdb, - 0x0d, 0x89, 0x6a, 0xd4, 0x18, 0xa5, 0xaf, 0xef, 0x5d, 0xab, 0x36, 0xf8, - 0x7c, 0x64, 0x79, 0x32, 0x39, 0x67, 0x2d, 0x50, 0xa6, 0x7b, 0x6a, 0xc1, - 0x6d, 0x6f, 0xcb, 0xac, 0x5d, 0x3e, 0x71, 0x1d, 0x48, 0x7c, 0xcd, 0x0e, - 0x4a, 0xc1, 0xc9, 0x64, 0xaa, 0x51, 0x55, 0xcc, 0x3b, 0xa0, 0x10, 0xb5, - 0x78, 0x3d, 0xcd, 0xd0, 0xef, 0x10, 0x56, 0x7e, 0x7c, 0xf1, 0x98, 0x62, - 0xc0, 0x0d, 0x71, 0x23, 0x02, 0x41, 0xef, 0x13, 0x29, 0xc5, 0x21, 0x3d, - 0x09, 0x83, 0xa5, 0x8f, 0x56, 0x5c, 0x12, 0xdd, 0x78, 0x6d, 0x68, 0xd8, - 0xbc, 0x31, 0x15, 0x8d, 0xe6, 0xcd, 0x02, 0x73, 0xbd, 0xfd, 0x8e, 0x58, - 0xf2, 0x16, 0x48, 0x96, 0x00, 0x57, 0x5b, 0x9f, 0x37, 0x34, 0xcf, 0xde, - 0x2a, 0x22, 0xc6, 0xf3, 0x30, 0x17, 0x56, 0x28, 0x50, 0x19, 0xc7, 0x77, - 0xf2, 0x3e, 0xed, 0x8f, 0x10, 0x11, 0x09, 0xe9, 0xff, 0xbd, 0x75, 0x65, - 0x52, 0x3b, 0x5c, 0x0f, 0xb4, 0x95, 0x09, 0xe6, 0x6a, 0x28, 0x91, 0x5e, - 0x26, 0xbf, 0xce, 0xfc, 0x75, 0x5c, 0xc0, 0x2d, 0xc8, 0x63, 0x7f, 0x31, - 0xd3, 0x59, 0xf0, 0xe2, 0xa7, 0xe8, 0x21, 0x4c, 0x99, 0xd5, 0x2f, 0x29, - 0x9f, 0x8c, 0x1f, 0x2c, 0xba, 0x34, 0xff, 0x1e, 0x96, 0x74, 0x58, 0x17, - 0x1a, 0x40, 0xe3, 0xc4, 0x46, 0xf0, 0xfd, 0x2b, 0x44, 0x3a, 0x06, 0x03, - 0x9f, 0x30, 0xac, 0xe8, 0xa0, 0x7e, 0xc9, 0xf1, 0x57, 0x7d, 0xb6, 0xf9, - 0x52, 0x4f, 0x1e, 0x70, 0x5e, 0xd7, 0x97, 0xe4, 0xa6, 0xf9, 0x9f, 0xed, - 0xa6, 0x05, 0x72, 0x1e, 0xbc, 0x68, 0x8f, 0x1a, 0x72, 0xe0, 0xb2, 0x67, - 0xe9, 0xcc, 0x4f, 0x26, 0x4f, 0x5a, 0x6c, 0x46, 0xda, 0x62, 0x0a, 0x47, - 0xf5, 0x89, 0xab, 0x0f, 0x80, 0x49, 0x3e, 0x18, 0xe5, 0xc0, 0x55, 0x9f, - 0x97, 0x18, 0xcc, 0x99, 0xb3, 0xb2, 0xa9, 0xb8, 0xdb, 0xfe, 0x0d, 0x94, - 0x16, 0xec, 0xe2, 0x62, 0x26, 0x5e, 0x93, 0x18, 0x09, 0x4a, 0x24, 0xf9, - 0xc0, 0x10, 0x3c, 0xcd, 0xcf, 0x77, 0xd7, 0xcd, 0x00, 0xde, 0xcd, 0x22, - 0x01, 0x60, 0x2b, 0x8f, 0x49, 0x86, 0x40, 0x70, 0x21, 0xee, 0x68, 0x3e, - 0x1a, 0x1e, 0x21, 0x58, 0x7a, 0xff, 0x70, 0x52, 0xd3, 0x0f, 0x76, 0x97, - 0x1e, 0x9c, 0x34, 0x86, 0xa4, 0x81, 0xdf, 0x81, 0xb2, 0x24, 0xc1, 0x69, - 0x56, 0x52, 0x37, 0x46, 0x4e, 0xee, 0xa0, 0xd0, 0xc6, 0xb2, 0xe9, 0x3f, - 0x35, 0xbd, 0xe3, 0xd0, 0x87, 0x36, 0xce, 0x85, 0xb8, 0xac, 0x48, 0xec, - 0xf4, 0x9d, 0xa7, 0x90, 0xed, 0x8b, 0x26, 0xff, 0x13, 0x1e, 0x55, 0xa3, - 0x81, 0x74, 0x03, 0xf5, 0x85, 0x03, 0xa2, 0x28, 0x43, 0x16, 0x55, 0xc2, - 0x8b, 0xb5, 0x84, 0x32, 0x3e, 0xd0, 0x2b, 0xde, 0x2f, 0x70, 0x0c, 0x96, - 0x4e, 0x59, 0x51, 0xb7, 0x19, 0x10, 0xdd, 0x19, 0x0d, 0x71, 0xfc, 0x37, - 0xa1, 0xfd, 0x19, 0x31, 0xe7, 0xa6, 0x52, 0x5c, 0x23, 0x1d, 0xf5, 0xe0, - 0x69, 0xe0, 0x2d, 0xb1, 0x76, 0xf2, 0xe0, 0xcf, 0xf5, 0x68, 0x33, 0x9d, - 0x05, 0x0e, 0x7c, 0x76, 0x7a, 0x4a, 0xf8, 0x54, 0x09, 0xb6, 0x0f, 0x9a, - 0x36, 0xba, 0x25, 0x26, 0x01, 0x57, 0xe4, 0x32, 0xc4, 0xa5, 0xe6, 0x57, - 0x18, 0xe4, 0x74, 0xa2, 0xfd, 0xee, 0x8e, 0x95, 0x4f, 0x35, 0x33, 0x3c, - 0xb0, 0x03, 0x5f, 0x65, 0xc8, 0x65, 0x59, 0x38, 0x9e, 0x98, 0x5f, 0x63, - 0x3d, 0x13, 0xa6, 0x19, 0x3c, 0x6f, 0x81, 0x40, 0x27, 0x5a, 0x30, 0x5c, - 0xbe, 0x67, 0x59, 0x96, 0xf6, 0x83, 0x53, 0x2f, 0xed, 0x01, 0x30, 0xb4, - 0xae, 0x13, 0x0c, 0xee, 0xc7, 0x47, 0x6b, 0xa0, 0xb7, 0x9e, 0xf0, 0xc3, - 0x60, 0x6e, 0x07, 0x88, 0x49, 0x47, 0xc1, 0x8f, 0x39, 0x20, 0xa3, 0x2a, - 0x3b, 0x39, 0xf6, 0x6c, 0xcd, 0xa8, 0x2c, 0x15, 0x9b, 0x37, 0x18, 0xf2, - 0x66, 0xd9,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 0x18, 0x1c, 0xc9, 0x57, 0xa1, 0xcb, - 0x58, 0x24, 0x71, 0x1a, 0x67, 0xb1, 0xdc, 0xe4, 0x0d, 0x99, 0xca, 0x28, - 0xf9, 0x23, 0xb2, 0xf9, 0x9f, 0x2b, 0x38, 0x30, 0x96, 0x43, 0xb1, 0x4c, - 0x01, 0x41, 0x35, 0x02, 0x12, 0x47, 0xb6, 0xe8, 0xd1, 0x15, 0xb2, 0x4b, - 0xed, 0xf9, 0xbb, 0x20, 0x6c, 0x7e, 0xe1, 0xf9, 0x2a, 0xa6, 0x2c, 0xb9, - 0x78, 0xc1, 0xb8, 0xdb, 0x4f, 0x25, 0x9a, 0x9c, - ]), - // 32-byte expectedSharedSecret - expectedSharedSecret: new Uint8Array([ - 0x2f, 0x52, 0x11, 0x10, 0xa9, 0xe8, 0x53, 0x86, 0x70, 0x13, 0xce, 0xe3, - 0x4a, 0x38, 0xf1, 0x07, 0xbe, 0xa1, 0xc4, 0x68, 0x90, 0x67, 0x16, 0x08, - 0xe4, 0xec, 0xa1, 0x13, 0xed, 0xe9, 0x09, 0x7e, - ]), + publicKey: hexStringToUint8Array( + '51e6707169475b3a308f014059583b8304cd2d93687e5315834644793510d8bcb46d9053afe0cb91095f39ac782b8a612781c9ff6a4ef7b17bb762c138b543f48654e6797066ecce85d43d42e793446b74e349296b445afd2c9f45646497d1083f329bc5723b3b6256396a135c310300411bfb17450350b7e180832c0038e2450e78f518ee318442cca136ab938ef87975258bf2cc5162b1a93d8a51ea52a1a8d4ca23b9b60bd68c7f4186a9806999cc886fa3692ffcbb46aaa28f856f9a774357402fb0a5ce80f69631e52336729e0438a1e93a214ae99f15263eff135de0a942d8b3c261b422c034b1bec79036b0a041c37be03334ae42cf8613283ee80e69314989f3696f1825bc53c894323e1775c72f779415b88487ec26f4b16446a0aab0e5226b837b8d13297e31b47b4b41a49b823f6964e5378a78063afa24b5e6294f270bba5a7b90e42a2d6ba4419f858adbb18f901c37a0f278bf6c468e723f00bcba3710809bd55e35bbb520dc9f44614665006f713b5ba264bb26b7106d89bb714c65c0f378df1651a575cd6377a28374b7668bb6b1436612a39c71eaa482eb78b7d07d4914873e36384290a7c44786e9b37b8b427882069f0a9018b487a5ffa8bc83d52aab57956397ac6056313b94b53ce1c39b717e9be28bc7ca12c4938e48bb031a563962c05f25a406da2b7c1b983a555c5ae793622c3193c4c175fe0a8dfe20c1cbb94d9697160160878c6720eef44f8c22549cf62a2b4cbffc119bd1c46a10d0661d5c4b1a9277aa3100d8e3636899bee543127cbb2a8c70b6768cc51aa439938725877187aa253eea51c6784c29b36507e4039c37b845ee4b058155a3b851ca685c054f8086ca955824ab4144c4368ddc70764a184c2a2abecc84add7650736a0f8865ec0c6b4be22345cebc6ed7a27d56161f350a605eb4b3f18a685db1606352e052a97e9a5cfb3b1c909f5545ce0a419c605b785940f32c622e31787c5a361f45ecda50b4b7546e755aa62679f13eaaa78755f3118991b0a579249599a3921471152634b4fe401b11ce7182c54a321899a94b445b7ca32be5c1302f77e51dc86fcf361593b13eb9cb01df3b16993c157c566ac0bbce31083cbb149535b05fdc86655a5766542341f99b9f2747718fb58ef1c0011184c21e3ca80b1b9128b796b169c2b0aad8ebb2da5369f44db2c995ca56756c668e4bdfe38862cc7bae4d1ae505c6e936cbaae9b42e5bb2868c141c25b81ed7cc706846ea9a059ea659602b429dc9111f1b0b318f7402fe20698a93b770978d6035db8d4065c49275ffabe6875c662156d2a07bd3d91cc9a703f0f1b63990363e49bbfb67c86782759f1e3afd1094d66b6100d872b7254bda0b17b17b9cd1544509f9a72b79c21969254823c5013244c681a7728297869bb7cae716f9d59868d0c2aef982153e218ab55b8ce969f3185268a880c31988738589d42b81bbce5aedb29b0e99337f2389aa54350289742456384669187d2c6918c59033c924969a36751b10134549975b277afd9033f50ce65dc633e5a1d01a3b6138c6f01f7aea179c7c8c79e4bfb203fd9b28fa23c14e655ba7791928ac46fe1a6b8b93658092768e65e85c5aed9e897dd8a45712aabcb7c191907656849559ed84d4077c114d911f9e8267028a5856a9023ba51086786689267a56b06e6281f1bc3434b01bf96b0243e0886d7f43725f9aa598b515cea401b7751e1a259816526232a75d07274f6bc4bd0d1a61ebb11804aa79f094008e5a19085431ac11c508a6fbd50268a8c8021c4b19bfa56909720bfb726cae9a7b7736faf17cfba9b3b4a32adbb0450e90024bbe82cdbb02f62005ef334798cb3bd7fdaa7fa635fe3a643ef745f1037cb6b824b7c608515e37f5b73a488248de17c665d3bb4d92575266a0f6565264eb6a4643b52b3d23a80254610585c22c330a1e235ebc73de0babf9b39a9c5f48ef0ac060fe96a00fa4be76bbc4728371de9646dfa7d5c833de1f646287633deb41f4676c744722507f1c353a85e85ea10b3d43e8a784c3ef262f281bdd5db44e03c4ecad2a05b480ba199bb32bb07afc46257f95bdf516fea63c66cc48426facacc0656b7f60179f792b7d686dfe707d7b916b1e8b24950c74b9b6001604e5d333a35992a7cc44ce3bc1bbdb8c72f08428d8a6e5920619d8196a7d3269533bdcd3435183b5d6e98' + ), + privateSeed: hexStringToUint8Array( + 'd710a2bc4789368cf20af5feeedc8b9a8d0a88ebd770f91e9a441146526f6b0e711d945a8786bdce9f167ddc5da8c7ab96dc305d6a366319d5f8a6924f183959' + ), + sampleCiphertext: hexStringToUint8Array( + 'd54df4d679314cfd6f3291cb644b9973145a788c98ef94e68e9f8d1f92eb842396849e6914d8cf53090257882f26b1fb4c07a2b6adeaf3bd568c5d3c5b54320d950fa55980af8d96fd7d4965825b638842929f7b6acf5dfd3033f3f345af313280e0105faadd42715fff55550caa64368967f158ca3a7d00aeb4df1eccde240f5b2110efe65f58e9b3ee54987e07eae195279afa373d7462a48d9c79b7c8a3f8162d8430bd0d97bd901436297c123e41f74096065469d587b9e742773ffef91346e351bb95b43b8c082a287b979891174e7186dc8cf2d64a07711f6e9f17cf02addcc3b803fdc2e3eec9d391841f0b385e2d3e0908ab84188267ceddcfb69d2f444f69008816458da4dad59a79e33783339ccceb5524a0227f114a2367dbcc5f9785ef15665e921e877b2405876743eced6d76af9d4aa6a68033c2435158d7b0106058ef9852a81a462bfb3cf8b16027e5e08250c12cb1e4130668173623356f9793db05bd065ea36a61326ccaf53d2ec0a134dc1fc6c72a403d274630b73464aaa16b46a71c82d8a027cb5005f22426c0b5314b04b708d7aca3f4b8538ec19253f940b4b815af22ce82bdcd7da85a61ac187c92ef38c8c29900519164823747eaa5f68bea24e87e623cb74dac2c7b57fa1f285316fd744b83800ef36636cdf529230dc69e7bb28bc5c648db1dbb6148ae0510999b48238c1050ee5ea04986274efea863de71f5528cefccd39e0e179b5749b72729013cbb1e85b96a134759d80bcab2a5e4eb93fd7eef26ae23ed1e07d59172a48d09aeeffafe12ad46d791bfc6a713307dad2b8ed41487f289eb2ccab83612b0ec61c8dc3280ae899a4b57e2e133b5db0d896ad418a5afef5dab36f87c64793239672d50a67b6ac16d6fcbac5d3e711d487ccd0e4ac1c964aa5155cc3ba010b5783dcdd0ef10567e7cf19862c00d71230241ef1329c5213d0983a58f565c12dd786d68d8bc31158de6cd0273bdfd8e58f216489600575b9f3734cfde2a22c6f3301756285019c777f23eed8f101109e9ffbd7565523b5c0fb49509e66a28915e26bfcefc755cc02dc8637f31d359f0e2a7e8214c99d52f299f8c1f2cba34ff1e967458171a40e3c446f0fd2b443a06039f30ace8a07ec9f1577db6f9524f1e705ed797e4a6f99feda605721ebc688f1a72e0b267e9cc4f264f5a6c46da620a47f589ab0f80493e18e5c0559f9718cc99b3b2a9b8dbfe0d9416ece262265e9318094a24f9c0103ccdcf77d7cd00decd2201602b8f4986407021ee683e1a1e21587aff7052d30f76971e9c3486a481df81b224c169565237464eeea0d0c6b2e93f35bde3d08736ce85b8ac48ecf49da790ed8b26ff131e55a3817403f58503a228431655c28bb584323ed02bde2f700c964e5951b71910dd190d71fc37a1fd1931e7a6525c231df5e069e02db176f2e0cff568339d050e7c767a4af85409b60f9a36ba25260157e432c4a5e65718e474a2fdee8e954f35333cb0035f65c86559389e985f633d13a6193c6f8140275a305cbe675996f683532fed0130b4ae130ceec7476ba0b79ef0c3606e07884947c18f3920a32a3b39f66ccda82c159b3718f266d90de831c901cc758cd0dfe4a4affb4de77aad1e8f9ddf5acf39cb6594b5009949e5bca50298d9ad8bc7ae021c489b304d7be8fcde0e18bf4a817d79f7b512d62b30aff6d2bc31a2940d074e6f78c013c8220696cfd02ec83145e7b9802a97042c28e9e61957cafb7dc45d2ba1297223db253ad5c17a71c7de34b67727bfffb6ea54247258550af963751ae43e2a2409b63595e82390fc24c67182b574adc14cc7f6536428ad93ee47e91a589a51963de73aee5b8b050e37da2c899b0a7b67e586c25efa76a23891ec12f935478c9970f7cee6acf92e3f457c35e633bf2acf087bd0ab5ac27a6df9fe097a29e0cf3893dfe4da6b660ce28364a6fb7425789b74f705d8e139481b600616c9c3a9c2add0f8862b44e4c14ed4268f8ed9a6a1efbbac2c9882badd148d14e009d15044cc4e035992009a6036bad6a9ae75fd3659877cd347a45d99e99db2175583ed3ceb2560a8fdcfa35c1509315d4c8fb0e4a0ac298113285629261dd9b2b38fee181cc957a1cb5824711a67b1dce40d99ca28f923b2f99f2b38309643b14c014135021247b6e8d115b24bedf9bb206c7ee1f92aa62cb978c1b8db4f259a9c' + ), + expectedSharedSecret: hexStringToUint8Array( + '2f521110a9e853867013cee34a38f107bea1c46890671608e4eca113ede9097e' + ), }; diff --git a/test/fixtures/wpt/WebCryptoAPI/generateKey/algorithm_registry.js b/test/fixtures/wpt/WebCryptoAPI/generateKey/algorithm_registry.js index 2c7493dfffd6..41512090f573 100644 --- a/test/fixtures/wpt/WebCryptoAPI/generateKey/algorithm_registry.js +++ b/test/fixtures/wpt/WebCryptoAPI/generateKey/algorithm_registry.js @@ -20,6 +20,9 @@ const generateKeyTestVectors = [ {name: "ML-KEM-512", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, {name: "ML-KEM-768", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, {name: "ML-KEM-1024", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, + {name: "MLKEM768-P256", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, + {name: "MLKEM768-X25519", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, + {name: "MLKEM1024-P384", resultType: "CryptoKeyPair", usages: ["decapsulateBits", "decapsulateKey", "encapsulateBits", "encapsulateKey"], mandatoryUsages: ["decapsulateBits", "decapsulateKey"]}, {name: "X25519", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, {name: "X448", resultType: "CryptoKeyPair", usages: ["deriveKey", "deriveBits"], mandatoryUsages: ["deriveKey", "deriveBits"]}, {name: "KMAC128", resultType: CryptoKey, usages: ["sign", "verify"], mandatoryUsages: []}, diff --git a/test/fixtures/wpt/WebCryptoAPI/generateKey/failures_Hybrid-KEM.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/generateKey/failures_Hybrid-KEM.tentative.https.any.js new file mode 100644 index 000000000000..40c69270c9a9 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/generateKey/failures_Hybrid-KEM.tentative.https.any.js @@ -0,0 +1,6 @@ +// META: title=WebCryptoAPI: generateKey() for Failures +// META: timeout=long +// META: script=../util/helpers.js +// META: script=algorithm_registry.js +// META: script=failures.js +run_test(["MLKEM768-P256", "MLKEM768-X25519", "MLKEM1024-P384"]); diff --git a/test/fixtures/wpt/WebCryptoAPI/generateKey/successes.js b/test/fixtures/wpt/WebCryptoAPI/generateKey/successes.js index c70ecb331873..894da971d898 100644 --- a/test/fixtures/wpt/WebCryptoAPI/generateKey/successes.js +++ b/test/fixtures/wpt/WebCryptoAPI/generateKey/successes.js @@ -47,23 +47,22 @@ function run_test(algorithmNames, slowTest) { assert_unreached("generateKey threw an unexpected error: " + err.toString()); }) .then(async function (result) { - // TODO: remove this block to enable ML-KEM JWK when its definition is done in IETF JOSE WG - if (result.publicKey?.algorithm.name.startsWith('ML-KEM')) { - const promises = [ - subtle.exportKey('spki', result.publicKey), - extractable ? subtle.exportKey('pkcs8', result.privateKey) : undefined, - subtle.exportKey('raw-public', result.publicKey), - ]; - if (extractable) - promises.push(subtle.exportKey('raw-seed', result.privateKey)); - await Promise.all(promises); - } else if (resultType === "CryptoKeyPair") { - const promises = [ - subtle.exportKey('jwk', result.publicKey), - extractable ? subtle.exportKey('jwk', result.privateKey) : undefined, - subtle.exportKey('spki', result.publicKey), - extractable ? subtle.exportKey('pkcs8', result.privateKey) : undefined, - ]; + if (resultType === "CryptoKeyPair") { + // TODO: enable ML-KEM JWK when its definition is done in IETF JOSE WG. + const isMlKem = result.publicKey.algorithm.name.startsWith('ML-KEM'); + const isHybridKem = result.publicKey.algorithm.name.startsWith('MLKEM'); + const promises = []; + + if (!isMlKem) { + promises.push(subtle.exportKey('jwk', result.publicKey)); + promises.push(extractable ? subtle.exportKey('jwk', result.privateKey) : undefined); + } + + if (!isHybridKem) { + promises.push(subtle.exportKey('spki', result.publicKey)); + if (extractable) + promises.push(subtle.exportKey('pkcs8', result.privateKey)); + } switch (result.publicKey.algorithm.name.substring(0, 2)) { case 'ML': @@ -90,7 +89,7 @@ function run_test(algorithmNames, slowTest) { const [jwkPub, jwkPriv] = await Promise.all(promises); - if (extractable) { + if (extractable && !isMlKem) { // Test that the JWK public key is a superset of the JWK private key. for (const [prop, value] of Object.entries(jwkPub)) { if (prop !== 'key_ops') { diff --git a/test/fixtures/wpt/WebCryptoAPI/generateKey/successes_Hybrid-KEM.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/generateKey/successes_Hybrid-KEM.tentative.https.any.js new file mode 100644 index 000000000000..bca75d4b6d71 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/generateKey/successes_Hybrid-KEM.tentative.https.any.js @@ -0,0 +1,7 @@ +// META: title=WebCryptoAPI: generateKey() Successful Calls +// META: timeout=long +// META: script=../util/helpers.js +// META: script=/common/subset-tests.js +// META: script=algorithm_registry.js +// META: script=successes.js +run_test(["MLKEM768-P256", "MLKEM768-X25519", "MLKEM1024-P384"]); diff --git a/test/fixtures/wpt/WebCryptoAPI/getPublicKey.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/getPublicKey.tentative.https.any.js index f67b11a47e63..c85d2a9e02ba 100644 --- a/test/fixtures/wpt/WebCryptoAPI/getPublicKey.tentative.https.any.js +++ b/test/fixtures/wpt/WebCryptoAPI/getPublicKey.tentative.https.any.js @@ -109,6 +109,24 @@ const algorithms = [ generateKeyParams: { name: "ML-KEM-1024" }, usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"], publicKeyUsages: ["encapsulateBits", "encapsulateKey"] + }, + { + name: "MLKEM768-P256", + generateKeyParams: { name: "MLKEM768-P256" }, + usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"], + publicKeyUsages: ["encapsulateBits", "encapsulateKey"] + }, + { + name: "MLKEM768-X25519", + generateKeyParams: { name: "MLKEM768-X25519" }, + usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"], + publicKeyUsages: ["encapsulateBits", "encapsulateKey"] + }, + { + name: "MLKEM1024-P384", + generateKeyParams: { name: "MLKEM1024-P384" }, + usages: ["encapsulateBits", "encapsulateKey", "decapsulateBits", "decapsulateKey"], + publicKeyUsages: ["encapsulateBits", "encapsulateKey"] } ]; @@ -145,8 +163,9 @@ algorithms.forEach(function(algorithm) { // Verify that the derived public key matches the original public key // by comparing their exported forms - const originalExported = await crypto.subtle.exportKey("spki", keyPair.publicKey); - const derivedExported = await crypto.subtle.exportKey("spki", publicKey); + const exportFormat = algorithm.name.startsWith("MLKEM") ? "raw-public" : "spki"; + const originalExported = await crypto.subtle.exportKey(exportFormat, keyPair.publicKey); + const derivedExported = await crypto.subtle.exportKey(exportFormat, publicKey); assert_array_equals( new Uint8Array(originalExported), diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey.tentative.https.any.js new file mode 100644 index 000000000000..3227434ed449 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey.tentative.https.any.js @@ -0,0 +1,11 @@ +// META: title=WebCryptoAPI: importKey() for Hybrid KEM keys +// META: timeout=long +// META: script=../util/helpers.js +// META: script=Hybrid-KEM_importKey_fixtures.js +// META: script=ml_importKey.js + +var keyData = hybridKemKeyData; + +runTests("MLKEM768-P256"); +runTests("MLKEM768-X25519"); +runTests("MLKEM1024-P384"); diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey_fixtures.js b/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey_fixtures.js new file mode 100644 index 000000000000..50b656c284c7 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/Hybrid-KEM_importKey_fixtures.js @@ -0,0 +1,56 @@ +var hybridKemKeyData = { + 'MLKEM768-P256': { + privateUsages: ['decapsulateBits', 'decapsulateKey'], + publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['jwk', 'raw-public'], + privateFormats: ['jwk', 'raw-seed'], + 'raw-public': hexStringToUint8Array( + '3d209f716752f6408e7f89bceef97ac388530045377927644ef046c0a7cae978c8841a0133aac4f1e1a7027277f671219cf58b85d29c8fec08edd432e787a3cf9936fe0026a113cb9efb1d7214049527bfe2141ea170b0294a59403ab0ce16760a8baa95b823cbb8aacdcc17ef32775223c791e3740163941f9bb3f63346bef1c050c31f932c62719429aff14c2bd438ab135bed692d56c77c04cbbffd6335b578318b513771e84b14ea821262141ca006ccb8bf2500aa1008970f216fe7f1ae34125aa290492c069a189222adc322f97649c762c7d3128ad3bb2667971d0744014bc3b67445cbcd0b3e7ea69fb1cb9f9c331f97487920187292926d04a25a2650abbd44982bb0c3c6301fe6a61330d24d8a3c7021dc3e3392c79a139b37613bba67a2984298507b84a4d61eef18acfb979af2d39caa4c0db4513815359d76fc378c63a7f4f3053b17168d0221cf0c2eec5514ba235f81d04d67c3b5c518094917671c26a7c046457533cc32844581277a03eb065c4529a779a9a5878f2aac3f81db9ed3d8c9345697058cbb99d379bca16d8fdb61d129960390524791b9d3e501b900bd1e5002e095be06c23f1fb212f5801f24b6b28c0c5493d246d02aa29fa3acfbe15ac4e212eb0b6f69ebbea259a2703aa4c308224bdb741c65c7a5d4bff788279507bbfe513d7aa5694e7b3cdf62ab36432742d4a0ca9b3570ba742fa803b46989c8526ea586cc4fc32866143b79601725fa545fd280b404530318bbc3371194710b6d74beaa629eb18a36a953b75915ae96999ba5c88cdc56a46861c50032c9b630bcc1445a30878979bc55a2c0955bf399b231203b90c651b6afe0e242b5a543250b142f7291ed753d816098f7913302a8ce91641716623d4fc2ac6772aa5f3674042b7c4a18a2186289a4ac4e200774596ca03e6798c7506b984999db6ac142586bae0799f1e776f9f5247dc574d8556ddf9bbbc4ca3643263457f74248010d62d4311268360aecb4902b450bf2050ecb8ba7a92820d233f5a14ed31225a1d17ca6f19e825894cfb1807d922cbd60761134be419144bcf72006366a4460137ad9136c113f05eb54c409520edc72e4150cc3a24b0f819eec11bbd19ca9645b0810a60b4a8a9e9c3955396a1653955b047bcf4f98433c27236c570d75f809e44aaf2dc33665826351872c293350ab324518c8c0c80b521c80c81a56bdc968a5650315a830c8bb17532c62ccc23b1d46412c256b224fd4674491803501d0143125c7577239689965b6989ca561793c0f85c62a9e13487da17662a7188c70b1040a67ed4c3f85e74e3691822fb96314d6134fe6a626b3cbe1461d62a7b573b2cc75579ffa22967e36ceb2a1aa0b71875a22751d706b72ca9ecd0c8100ad0aa58009a5c83fffe91759e6baa0a9345af99fe3b69509dbc84032868844ab3f65bb1df8beadf36442e48e339c967023a525411544c789a2f04dacd06ffef78302210450b931f6b4c32aab34a3f5260b810f4c9a946fc22d3baabaa80ba8d9955d6dc35e8609b4256b482cdc9d8977c1a47a354e7c527fdb1672e166917b95cd6351820261daab361f8a2dcbb240c55abd6a8105e5291b427b566d731e6b7047189cff20d8b120e0b3e72472d1b0086812200fd3698e23f06e4f4e08bbb54cc2049c039c845be659999c8fa48d7f62327c146cf1bc0b0bb1b91b30174b7bc220d422023bff6b0dee263532c503f3982e4d3e27071b855578a9a9aa63b8a8c339bf' + ), + 'raw-seed': hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + jwk: { + priv: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + kty: 'AKP', + alg: 'MLKEM768-P256', + pub: 'PSCfcWdS9kCOf4m87vl6w4hTAEU3eSdkTvBGwKfK6XjIhBoBM6rE8eGnAnJ39nEhnPWLhdKcj-wI7dQy54ejz5k2_gAmoRPLnvsdchQElSe_4hQeoXCwKUpZQDqwzhZ2Couqlbgjy7iqzcwX7zJ3UiPHkeN0AWOUH5uz9jNGvvHAUMMfkyxicZQpr_FMK9Q4qxNb7WktVsd8BMu__WM1tXgxi1E3cehLFOqCEmIUHKAGzLi_JQCqEAiXDyFv5_GuNBJaopBJLAaaGJIircMi-XZJx2LH0xKK07smZ5cdB0QBS8O2dEXLzQs-fqafscufnDMfl0h5IBhykpJtBKJaJlCrvUSYK7DDxjAf5qYTMNJNijxwIdw-M5LHmhObN2E7umeimEKYUHuEpNYe7xis-5ea8tOcqkwNtFE4FTWddvw3jGOn9PMFOxcWjQIhzwwu7FUUuiNfgdBNZ8O1xRgJSRdnHCanwEZFdTPMMoRFgSd6A-sGXEUpp3mppYePKqw_gdue09jJNFaXBYy7mdN5vKFtj9th0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3vCINQiAjv_aw3uJjUyxQPzmC5NPicHG4VVeKmpqmO4qMM5vw', + }, + }, + 'MLKEM768-X25519': { + privateUsages: ['decapsulateBits', 'decapsulateKey'], + publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['jwk', 'raw-public'], + privateFormats: ['jwk', 'raw-seed'], + 'raw-public': hexStringToUint8Array( + '3d209f716752f6408e7f89bceef97ac388530045377927644ef046c0a7cae978c8841a0133aac4f1e1a7027277f671219cf58b85d29c8fec08edd432e787a3cf9936fe0026a113cb9efb1d7214049527bfe2141ea170b0294a59403ab0ce16760a8baa95b823cbb8aacdcc17ef32775223c791e3740163941f9bb3f63346bef1c050c31f932c62719429aff14c2bd438ab135bed692d56c77c04cbbffd6335b578318b513771e84b14ea821262141ca006ccb8bf2500aa1008970f216fe7f1ae34125aa290492c069a189222adc322f97649c762c7d3128ad3bb2667971d0744014bc3b67445cbcd0b3e7ea69fb1cb9f9c331f97487920187292926d04a25a2650abbd44982bb0c3c6301fe6a61330d24d8a3c7021dc3e3392c79a139b37613bba67a2984298507b84a4d61eef18acfb979af2d39caa4c0db4513815359d76fc378c63a7f4f3053b17168d0221cf0c2eec5514ba235f81d04d67c3b5c518094917671c26a7c046457533cc32844581277a03eb065c4529a779a9a5878f2aac3f81db9ed3d8c9345697058cbb99d379bca16d8fdb61d129960390524791b9d3e501b900bd1e5002e095be06c23f1fb212f5801f24b6b28c0c5493d246d02aa29fa3acfbe15ac4e212eb0b6f69ebbea259a2703aa4c308224bdb741c65c7a5d4bff788279507bbfe513d7aa5694e7b3cdf62ab36432742d4a0ca9b3570ba742fa803b46989c8526ea586cc4fc32866143b79601725fa545fd280b404530318bbc3371194710b6d74beaa629eb18a36a953b75915ae96999ba5c88cdc56a46861c50032c9b630bcc1445a30878979bc55a2c0955bf399b231203b90c651b6afe0e242b5a543250b142f7291ed753d816098f7913302a8ce91641716623d4fc2ac6772aa5f3674042b7c4a18a2186289a4ac4e200774596ca03e6798c7506b984999db6ac142586bae0799f1e776f9f5247dc574d8556ddf9bbbc4ca3643263457f74248010d62d4311268360aecb4902b450bf2050ecb8ba7a92820d233f5a14ed31225a1d17ca6f19e825894cfb1807d922cbd60761134be419144bcf72006366a4460137ad9136c113f05eb54c409520edc72e4150cc3a24b0f819eec11bbd19ca9645b0810a60b4a8a9e9c3955396a1653955b047bcf4f98433c27236c570d75f809e44aaf2dc33665826351872c293350ab324518c8c0c80b521c80c81a56bdc968a5650315a830c8bb17532c62ccc23b1d46412c256b224fd4674491803501d0143125c7577239689965b6989ca561793c0f85c62a9e13487da17662a7188c70b1040a67ed4c3f85e74e3691822fb96314d6134fe6a626b3cbe1461d62a7b573b2cc75579ffa22967e36ceb2a1aa0b71875a22751d706b72ca9ecd0c8100ad0aa58009a5c83fffe91759e6baa0a9345af99fe3b69509dbc84032868844ab3f65bb1df8beadf36442e48e339c967023a525411544c789a2f04dacd06ffef78302210450b931f6b4c32aab34a3f5260b810f4c9a946fc22d3baabaa80ba8d9955d6dc35e8609b4256b482cdc9d8977c1a47a354e7c527fdb1672e166917b95cd6351820261daab361f8a2dcbb240c55abd6a8105e5291b427b566d731e6b7047189cff20d8b120e0b3e72472d1b0086812200fd3698e23f06e4f4e08bbb54cc2f63601b7f85accfeea2d17964c66b5194b0f08e18519faaee194e3c102823062' + ), + 'raw-seed': hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + jwk: { + priv: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + kty: 'AKP', + alg: 'MLKEM768-X25519', + pub: 'PSCfcWdS9kCOf4m87vl6w4hTAEU3eSdkTvBGwKfK6XjIhBoBM6rE8eGnAnJ39nEhnPWLhdKcj-wI7dQy54ejz5k2_gAmoRPLnvsdchQElSe_4hQeoXCwKUpZQDqwzhZ2Couqlbgjy7iqzcwX7zJ3UiPHkeN0AWOUH5uz9jNGvvHAUMMfkyxicZQpr_FMK9Q4qxNb7WktVsd8BMu__WM1tXgxi1E3c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HWiJ1HXBrcsqezQyBAK0KpYAJpcg__-kXWea6oKk0Wvmf47aVCdvIQDKGiESrP2W7Hfi-rfNkQuSOM5yWcCOlJUEVRMeJovBNrNBv_veDAiEEULkx9rTDKqs0o_UmC4EPTJqUb8ItO6q6qAuo2ZVdbcNehgm0JWtILNydiXfBpHo1TnxSf9sWcuFmkXuVzWNRggJh2qs2H4oty7JAxVq9aoEF5SkbQntWbXMea3BHGJz_INixIOCz5yRy0bAIaBIgD9NpjiPwbk9OCLu1TML2NgG3-FrM_uotF5ZMZrUZSw8I4YUZ-q7hlOPBAoIwYg', + }, + }, + 'MLKEM1024-P384': { + privateUsages: ['decapsulateBits', 'decapsulateKey'], + publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['jwk', 'raw-public'], + privateFormats: ['jwk', 'raw-seed'], + 'raw-public': hexStringToUint8Array( + 'a10bc8b554cd51980cdbbccc3041420fd320fe8b74c7a84278c63c17070dc231b61ab269b9d677d920261186654b4571f51797d5c342b8070bc6c92bca16adecc631e4e94c7508b111730c749c73e2d6a6f97155cb269ccc06a71a21bef3d269463c935048a7f4636c7b320073709023f7b04d0530571a9a6f718280870bb63875d3f599bc229b95869cd5bb5d26640856d40b828198fdf2c099998ffdf772e462336c521cd326b5e4997bd95c135c57bd02c7afa80a2923d510951778ee5125b2aa18f90445453b85789224725b259279698ac9426c882baabc38d4fb3a3f6831180918b9825e0e418154d78aebab5e7e7066e69b2567476bf1177fe079a38298be6f01b098c33851ab25312b52e32a5750c2b73d293c0b810473b310aaf062f19914c7377b2e90388f575bf5e6853453b95a74aa18d62d4ae37e6996a48ab5217488a92d7b01e315c50b68204143792afc4f8367c0ce065ab32014bdb5515fe0594608aad1218994724afaaaa2df0355f46666b6e02a387b6d3da4713edb610bb048c3a2078b800e9ea483f2009c96d24c71b2cbc8e1200c0277383c5c27895e298c3607701ce58702a91903274a041408234cb0021ef2b1c5131419b444dc84b89d147d1fe43c43f676d906735d9ca2a59c2232d97fd4aa1ae2bb3d1b170ca553cb2574954fdc6689fac623cbaa31982d82424d5a564fef7a8ba51b44df15053b2b45bec4aa1ed49929123daf754175c5938258c608b24d062042ab4bbee5e553a5ea627521738ae5ab2e06bd98b020787b2f5fa51eb4c46c2bf90e55a49560340667f88ac41432b7f551dfd98c037c79f79b41b985a8b1f51345550cd816714362040778c43e378a288394bd028c8c31b5a904bc4a5648a596035cb38f0e276e12c9a96f8425056b05a136642dd2cb75463036485ba1a50539e420e1e31dfac529cad6c68ec06746749473e050a4ac92b7199beceb239b6c12c8e716b66607aeca64a5850b01f99d0b176a7759781ed77cb1ba40d17ac5c6cb06c942c002c2cf6efcb121f10ad2a45ff781426e7104cbdca73b81865ab22b00ba834355ae485a262f354248932c2be178369a3dd7e2428fdc379346ab2b754c43db657460cb09c5c48b5810cb7a5c6156cf87440c9e36a4869a8ac458b382fc178915a9ce1bcdda7c48807c207e656ffb80bf33e32bc8c7b20ef60572612ceac99ad1c56ce5a764b29b74c17a5b510b1afcb18a1afc35c12ac213725325f9b7a2eb338fe4c0080c31a58a995db7027d900e78544887f90ada467d0e383c119c5399310bc6735874e8804ff6c2bae57f2c3357cb627033c12a5924b20ce5abf113172bd2b77086cac543811793bba71734c9f005ac2656460bc30a442b388725758a623e37ba6e293abfb84f344229f373c214ca776a7c05adc465fed93b9cf77f0022ab71f1adde369dd8f420a58c057c14cc18dc47da7c12b086473eab419652967001c4e42a381c8ba539a875d21a9945133bab9bc1e53a600de77cbfb2aeab6b19ced4c6eaa8998ee6a1577255f7132d80a32d6c0c6ec44c9c4b28699a645bb0bc958e00275077925309519b0824c7000dfa61912ec049063a067d00b059053e508a5bfee63473869c8a8510af898cd7572854f5c38af96f5f97a7372632ea7bb4b6fb831c612af71191ff9806b379bcd43c6059b7b1f953741444af713c155d962722b947aa23a32a89b356a6a7508aad63968c1dea78ff18aac27a89aa7b42b0d7481dd3cc649421e51397782218ac5441760ba51a0328d66b436fec32d7aa4d68e0cad1bc14f7241c903480f809983fc2c30d93138cf63b59bc737ac08192893d039187a811bef3d3209eb7b8d1e05b5b251cef760a210b2732867ab32049ba3c354e3858aee7b71df792924730d8e842e484122b50677b0a306e61cf21b62091da18b937192936a09e5a418cf78b666157dd477af1c36a12320129522840e370941157808782a5335b0ac10d70e1beafd401074b84b9826cc58aad217bae0f419b2da896133272d8f22c6f420fcc738fccc1082fc93c7df0994c6bcf2cc8a29037b6bb2b4bcef4b0ee8caf8506bc5ecba082a56806c1cede0b944338a69a668254c1150ae05030e256b2b67661ba027d97576da613ac8c7c29051f1240b96b0c127e264d5e1dbbfe9561a567d5c9103673b446b3ccea6c5f7f34f09348a5d4a58b0498871dc940ee97b50c0336f9a60c3299f99560ac70657a27befa702265ce590583e04a28326092d3dea2118dd1df5e81d7d3014ec4b5ce67dcb45ef001769dd5d5ada76934d38d740924712bfae672169d8f8744c151346d285fbb653f83aa0f' + ), + 'raw-seed': hexStringToUint8Array( + '0000000000000000000000000000000000000000000000000000000000000000' + ), + jwk: { + priv: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + kty: 'AKP', + alg: 'MLKEM1024-P384', + pub: 'oQvItVTNUZgM27zMMEFCD9Mg_ot0x6hCeMY8FwcNwjG2GrJpudZ32SAmEYZlS0Vx9ReX1cNCuAcLxskryhat7MYx5OlMdQixEXMMdJxz4tam-XFVyyaczAanGiG-89JpRjyTUEin9GNsezIAc3CQI_ewTQUwVxqab3GCgIcLtjh10_WZvCKblYac1btdJmQIVtQLgoGY_fLAmZmP_fdy5GIzbFIc0ya15Jl72VwTXFe9AsevqAopI9UQlRd47lElsqoY-QRFRTuFeJIkclslknlpislCbIgrqrw41Ps6P2gxGAkYuYJeDkGBVNeK66tefnBm5pslZ0dr8Rd_4Hmjgpi-bwGwmMM4UaslMStS4ypXUMK3PSk8C4EEc7MQqvBi8ZkUxzd7LpA4j1db9eaFNFO5WnSqGNYtSuN-aZakirUhdIipLXsB4xXFC2ggQUN5KvxPg2fAzgZasyAUvbVRX-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Y0c4acioUQr4mM11coVPXDivlvX5enNyYy6nu0tvuDHGEq9xGR_5gGs3m81DxgWbex-VN0FESvcTwVXZYnIrlHqiOjKomzVqanUIqtY5aMHep4_xiqwnqJqntCsNdIHdPMZJQh5ROXeCIYrFRBdgulGgMo1mtDb-wy16pNaODK0bwU9yQckDSA-AmYP8LDDZMTjPY7WbxzesCBkok9A5GHqBG-89Mgnre40eBbWyUc73YKIQsnMoZ6syBJujw1TjhYrue3HfeSkkcw2OhC5IQSK1BnewowbmHPIbYgkdoYuTcZKTagnlpBjPeLZmFX3Ud68cNqEjIBKVIoQONwlBFXgIeCpTNbCsENcOG-r9QBB0uEuYJsxYqtIXuuD0GbLaiWEzJy2PIsb0IPzHOPzMEIL8k8ffCZTGvPLMiikDe2uytLzvSw7oyvhQa8XsuggqVoBsHO3guUQzimmmaCVMEVCuBQMOJWsrZ2YboCfZdXbaYTrIx8KQUfEkC5awwSfiZNXh27_pVhpWfVyRA2c7RGs8zqbF9_NPCTSKXUpYsEmIcdyUDul7UMAzb5pgwymfmVYKxwZXonvvpwImXOWQWD4EooMmCS096iEY3R316B19MBTsS1zmfctF7wAXad1dWtp2k00410CSRxK_rmchadj4dEwVE0bShfu2U_g6oP', + }, + }, +}; diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/ML-DSA_importKey_fixtures.js b/test/fixtures/wpt/WebCryptoAPI/import_export/ML-DSA_importKey_fixtures.js index abccc10c63fb..463213a80147 100644 --- a/test/fixtures/wpt/WebCryptoAPI/import_export/ML-DSA_importKey_fixtures.js +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/ML-DSA_importKey_fixtures.js @@ -4,6 +4,8 @@ var keyData = { 'ML-DSA-44': { privateUsages: ['sign'], publicUsages: ['verify'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: mldsaKeyFixtures.pkcs8['ML-DSA-44'], spki: mldsaKeyFixtures.spki['ML-DSA-44'], 'raw-public': hexStringToUint8Array( @@ -23,6 +25,8 @@ var keyData = { 'ML-DSA-65': { privateUsages: ['sign'], publicUsages: ['verify'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: mldsaKeyFixtures.pkcs8['ML-DSA-65'], spki: mldsaKeyFixtures.spki['ML-DSA-65'], 'raw-public': hexStringToUint8Array( @@ -42,6 +46,8 @@ var keyData = { 'ML-DSA-87': { privateUsages: ['sign'], publicUsages: ['verify'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: mldsaKeyFixtures.pkcs8['ML-DSA-87'], spki: mldsaKeyFixtures.spki['ML-DSA-87'], 'raw-public': hexStringToUint8Array( diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/ML-KEM_importKey_fixtures.js b/test/fixtures/wpt/WebCryptoAPI/import_export/ML-KEM_importKey_fixtures.js index f3a5f6687dc5..3adec94ec410 100644 --- a/test/fixtures/wpt/WebCryptoAPI/import_export/ML-KEM_importKey_fixtures.js +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/ML-KEM_importKey_fixtures.js @@ -2,6 +2,8 @@ var keyData = { 'ML-KEM-512': { privateUsages: ['decapsulateBits', 'decapsulateKey'], publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: new Uint8Array([ 48, 84, 2, 1, 0, 48, 11, 6, 9, 96, 134, 72, 1, 101, 3, 4, 4, 1, 4, 66, 128, 64, 165, 38, 193, 164, 132, 122, 104, 173, 83, 214, 227, 31, 231, @@ -33,6 +35,8 @@ var keyData = { 'ML-KEM-768': { privateUsages: ['decapsulateBits', 'decapsulateKey'], publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: new Uint8Array([ 48, 84, 2, 1, 0, 48, 11, 6, 9, 96, 134, 72, 1, 101, 3, 4, 4, 2, 4, 66, 128, 64, 166, 200, 29, 100, 198, 48, 80, 164, 143, 215, 2, 108, 106, 162, @@ -63,6 +67,8 @@ var keyData = { 'ML-KEM-1024': { privateUsages: ['decapsulateBits', 'decapsulateKey'], publicUsages: ['encapsulateBits', 'encapsulateKey'], + publicFormats: ['spki', 'jwk', 'raw-public'], + privateFormats: ['pkcs8', 'jwk', 'raw-seed'], pkcs8: new Uint8Array([ 48, 84, 2, 1, 0, 48, 11, 6, 9, 96, 134, 72, 1, 101, 3, 4, 4, 3, 4, 66, 128, 64, 152, 117, 178, 230, 181, 134, 244, 129, 167, 125, 166, 8, 181, diff --git a/test/fixtures/wpt/WebCryptoAPI/import_export/ml_importKey.js b/test/fixtures/wpt/WebCryptoAPI/import_export/ml_importKey.js index a33c3a85b912..545cec51b59f 100644 --- a/test/fixtures/wpt/WebCryptoAPI/import_export/ml_importKey.js +++ b/test/fixtures/wpt/WebCryptoAPI/import_export/ml_importKey.js @@ -11,7 +11,7 @@ function runTests(algorithmName) { [true, false].forEach(function (extractable) { // Test public keys first allValidUsages(data.publicUsages, true).forEach(function (usages) { - ['spki', 'jwk', 'raw-public'].forEach(function (format) { + data.publicFormats.forEach(function (format) { if (format === 'jwk') { // Not all fields used for public keys testFormat( @@ -37,7 +37,7 @@ function runTests(algorithmName) { // Next, test private keys allValidUsages(data.privateUsages).forEach(function (usages) { - ['pkcs8', 'jwk', 'raw-seed'].forEach(function (format) { + data.privateFormats.forEach(function (format) { testFormat(format, algorithm, data, algorithmName, usages, extractable); }); }); diff --git a/test/fixtures/wpt/WebCryptoAPI/serialization/hybridkem.tentative.https.window.js b/test/fixtures/wpt/WebCryptoAPI/serialization/hybridkem.tentative.https.window.js new file mode 100644 index 000000000000..465f86df55a8 --- /dev/null +++ b/test/fixtures/wpt/WebCryptoAPI/serialization/hybridkem.tentative.https.window.js @@ -0,0 +1,32 @@ +// META: title=WebCryptoAPI: Hybrid KEM CryptoKey serialization +// META: script=../util/helpers.js +// META: script=serialization.js +run_test([ + { + name: 'MLKEM768-P256', + resultType: 'CryptoKeyPair', + usages: [ + 'decapsulateBits', 'decapsulateKey', 'encapsulateBits', 'encapsulateKey' + ], + publicFormat: 'raw-public', + privateFormat: 'raw-seed' + }, + { + name: 'MLKEM768-X25519', + resultType: 'CryptoKeyPair', + usages: [ + 'decapsulateBits', 'decapsulateKey', 'encapsulateBits', 'encapsulateKey' + ], + publicFormat: 'raw-public', + privateFormat: 'raw-seed' + }, + { + name: 'MLKEM1024-P384', + resultType: 'CryptoKeyPair', + usages: [ + 'decapsulateBits', 'decapsulateKey', 'encapsulateBits', 'encapsulateKey' + ], + publicFormat: 'raw-public', + privateFormat: 'raw-seed' + }, +]); diff --git a/test/fixtures/wpt/WebCryptoAPI/supports-modern.tentative.https.any.js b/test/fixtures/wpt/WebCryptoAPI/supports-modern.tentative.https.any.js index a8f730e9bfc4..5c4699dcfb7f 100644 --- a/test/fixtures/wpt/WebCryptoAPI/supports-modern.tentative.https.any.js +++ b/test/fixtures/wpt/WebCryptoAPI/supports-modern.tentative.https.any.js @@ -33,6 +33,24 @@ const modernAlgorithms = { 'decapsulateKey', 'decapsulateBits', 'getPublicKey' ], }, + 'MLKEM768-P256': { + operations: [ + 'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits', + 'decapsulateKey', 'decapsulateBits', 'getPublicKey' + ], + }, + 'MLKEM768-X25519': { + operations: [ + 'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits', + 'decapsulateKey', 'decapsulateBits', 'getPublicKey' + ], + }, + 'MLKEM1024-P384': { + operations: [ + 'generateKey', 'importKey', 'encapsulateKey', 'encapsulateBits', + 'decapsulateKey', 'decapsulateBits', 'getPublicKey' + ], + }, // Symmetric algorithms 'ChaCha20-Poly1305': { diff --git a/test/fixtures/wpt/WebCryptoAPI/util/helpers.js b/test/fixtures/wpt/WebCryptoAPI/util/helpers.js index cc44dd16b1c9..86a4a79f0b9d 100644 --- a/test/fixtures/wpt/WebCryptoAPI/util/helpers.js +++ b/test/fixtures/wpt/WebCryptoAPI/util/helpers.js @@ -31,6 +31,9 @@ var registeredAlgorithmNames = [ "ML-KEM-512", "ML-KEM-768", "ML-KEM-1024", + "MLKEM768-P256", + "MLKEM768-X25519", + "MLKEM1024-P384", "ChaCha20-Poly1305", "Argon2i", "Argon2d", diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index fa3732a0e9fd..9e7979e55460 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -100,7 +100,7 @@ "path": "web-locks" }, "WebCryptoAPI": { - "commit": "e235e089b4e44a598f2d61e93732e0c4d9f03e04", + "commit": "55ce71bb9deaf4b8a30fe80f95558a10699fb433", "path": "WebCryptoAPI" }, "webidl": { From e33d1b633a4c3289ad8b32418df5137673208b3d Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sat, 5 Sep 2026 16:21:43 +0200 Subject: [PATCH 2/2] fixup! test: update WPT for WebCryptoAPI to 55ce71bb9d --- test/wpt/status/WebCryptoAPI.cjs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/test/wpt/status/WebCryptoAPI.cjs b/test/wpt/status/WebCryptoAPI.cjs index 7715d5456152..eb85fa94e63e 100644 --- a/test/wpt/status/WebCryptoAPI.cjs +++ b/test/wpt/status/WebCryptoAPI.cjs @@ -54,21 +54,25 @@ if (!hasOpenSSL(3, 5) && !isBoringSSL) { skip( 'encap_decap/encap_decap_bits.tentative.https.any.js', 'encap_decap/encap_decap_keys.tentative.https.any.js', + 'generateKey/failures_Hybrid-KEM.tentative.https.any.js', 'generateKey/failures_ML-DSA.tentative.https.any.js', 'generateKey/failures_ML-KEM.tentative.https.any.js', + 'generateKey/successes_Hybrid-KEM.tentative.https.any.js', 'generateKey/successes_ML-DSA.tentative.https.any.js', 'generateKey/successes_ML-KEM.tentative.https.any.js', + 'import_export/Hybrid-KEM_importKey.tentative.https.any.js', 'import_export/ML-DSA_importKey.tentative.https.any.js', 'import_export/ML-KEM_importKey.tentative.https.any.js', + 'serialization/hybridkem.tentative.https.window.js', 'serialization/mldsa.tentative.https.any.js', 'serialization/mlkem.tentative.https.any.js', 'sign_verify/mldsa.tentative.https.any.js'); skipSubtests( - ['getPublicKey.tentative.https.any.js', /ml-(?:kem|dsa)/i], + ['getPublicKey.tentative.https.any.js', /ml-?(?:kem|dsa)/i], [ 'supports-modern.tentative.https.any.js', - /(?:ml-(?:kem|dsa)|(?:en|de)capsulateKey)/i, + /(?:ml-?(?:kem|dsa)|(?:en|de)capsulateKey)/i, ]); } @@ -79,26 +83,30 @@ if (isBoringSSL) { 'digest/cshake.tentative.https.any.js', 'digest/sha3.tentative.https.any.js', 'generateKey/failures_Ed448.tentative.https.any.js', + 'generateKey/failures_Hybrid-KEM.tentative.https.any.js', 'generateKey/failures_X448.tentative.https.any.js', 'generateKey/successes_Ed448.tentative.https.any.js', + 'generateKey/successes_Hybrid-KEM.tentative.https.any.js', 'generateKey/successes_X448.tentative.https.any.js', + 'import_export/Hybrid-KEM_importKey.tentative.https.any.js', 'import_export/okp_importKey_Ed448.tentative.https.any.js', 'import_export/okp_importKey_failures_Ed448.tentative.https.any.js', 'import_export/okp_importKey_failures_X448.tentative.https.any.js', 'import_export/okp_importKey_X448.tentative.https.any.js', 'serialization/ed448.tentative.https.any.js', + 'serialization/hybridkem.tentative.https.window.js', 'serialization/x448.tentative.https.any.js', 'sign_verify/eddsa_curve448.tentative.https.any.js'); skipSubtests( - ['encap_decap/encap_decap_bits.tentative.https.any.js', /ml-kem-512/i], - ['encap_decap/encap_decap_keys.tentative.https.any.js', /ml-kem-512/i], + ['encap_decap/encap_decap_bits.tentative.https.any.js', /(?:ml-kem-512|mlkem)/i], + ['encap_decap/encap_decap_keys.tentative.https.any.js', /(?:ml-kem-512|mlkem)/i], ['generateKey/failures_ML-KEM.tentative.https.any.js', /ml-kem-512/i], ['generateKey/successes_ML-KEM.tentative.https.any.js', /ml-kem-512/i], - ['getPublicKey.tentative.https.any.js', /(?:ed448|x448|ml-kem-512)/i], + ['getPublicKey.tentative.https.any.js', /(?:ed448|x448|ml-kem-512|mlkem)/i], ['import_export/ML-KEM_importKey.tentative.https.any.js', /ml-kem-512/i], ['serialization/mlkem.tentative.https.any.js', /ml-kem-512/i], - ['supports-modern.tentative.https.any.js', /ml-kem-512/i]); + ['supports-modern.tentative.https.any.js', /(?:ml-kem-512|mlkem)/i]); } if (hasFIPS(3)) { @@ -144,12 +152,16 @@ if (hasFIPS(3, 5)) { 'derive_bits_keys/cfrg_curves_bits_curve448.tentative.https.any.js', 'derive_bits_keys/cfrg_curves_keys_curve25519.https.any.js', 'derive_bits_keys/cfrg_curves_keys_curve448.tentative.https.any.js', + 'generateKey/failures_Hybrid-KEM.tentative.https.any.js', + 'generateKey/successes_Hybrid-KEM.tentative.https.any.js', 'generateKey/successes_X25519.https.any.js', 'generateKey/successes_X448.tentative.https.any.js', + 'import_export/Hybrid-KEM_importKey.tentative.https.any.js', 'import_export/okp_importKey_X25519.https.any.js', 'import_export/okp_importKey_X448.tentative.https.any.js', 'import_export/okp_importKey_failures_X25519.https.any.js', 'import_export/okp_importKey_failures_X448.tentative.https.any.js', + 'serialization/hybridkem.tentative.https.window.js', 'serialization/x25519.https.any.js', 'serialization/x448.tentative.https.any.js'); @@ -158,11 +170,14 @@ if (hasFIPS(3, 5)) { 'derive_bits_keys/derived_bits_length.https.any.js', /^X25519 derivation/, ], - ['getPublicKey.tentative.https.any.js', /(?:X25519|X448)/], + ['encap_decap/encap_decap_bits.tentative.https.any.js', /mlkem/i], + ['encap_decap/encap_decap_keys.tentative.https.any.js', /mlkem/i], + ['getPublicKey.tentative.https.any.js', /(?:X25519|X448|MLKEM)/], [ 'import_export/raw_format_aliases.tentative.https.any.js', /(?:X25519|X448)/, ], + ['supports-modern.tentative.https.any.js', /mlkem/i], [ 'supports.tentative.https.any.js', /(?:X25519|^deriveKey promise tests|^supports validates the ECDH public key$)/,