Skip to content

Commit

Permalink
Add more k256 tests - update keys on auth vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
erskingardner committed Aug 12, 2024
1 parent e286e9f commit 9fbbcde
Show file tree
Hide file tree
Showing 3 changed files with 276 additions and 28 deletions.
275 changes: 275 additions & 0 deletions tests/k256.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
[
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "17adde3164d65a90d077fd9a0fdba665152c3336",
"ikmE": "4e627f7d755a76961e60ee218c2ab33ee877c49a2363bf03ae4dea2c811bf3c6",
"skEm": "30fbc0d41cd01885333211ff53b9ed29bcbdccc3ff13625a82db61a7bb8eae19",
"pkEm": "04591775168f328a2adbcb887acd287d55a1025d7d2b15e1937278a5efd1d48b19c00cf07559320e6d278a71c9e58bae5d9ab041d7905c66291f4d08459c946e18",
"enc": "04591775168f328a2adbcb887acd287d55a1025d7d2b15e1937278a5efd1d48b19c00cf07559320e6d278a71c9e58bae5d9ab041d7905c66291f4d08459c946e18",
"ikmR": "1020a03f4ec8eaf31018ee2c06774580fa5c6a1d5ead187bbcaf1412d003e381",
"skRm": "a795c287c132154a8b96dc81dc8b4e2f02bbbad78dab0567b59db1d1540751f6",
"pkRm": "043ee7314407753d1ba296de29f07b2cd5505ca94b614f127e71f3c19fc7845daf49c9bb4bf4d00d3b5411c8eb86d59a2dcadc5a13115fa9fef44d1e0b7ef11cab",
"shared_secret": "7eabf4bab973fc9cc8b3bb2fdaa4d7f154309c31d11214cc48b4a8f3d65236f7",
"key_schedule_context": "",
"secret": "",
"key": "c508c44d920152fb8dd597c8edce4cd1",
"base_nonce": "4ac4413d13c5713d6c76fad2",
"exporter_secret": "dd82a88bd58f05bc453a77495898af2df905be8b6ffe096a071b80edf3428d1c",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "1cdae379030a0423b12fc76ee1354749bede74e0",
"ikmE": "e1528622348377db6d394241993bb5f4a743c94b2790a2e7546c1588ba4fd317",
"skEm": "0e102a20d5cad700fb7742f40d6fee95097216e75a9ab73150302a8aceaa0382",
"pkEm": "04f5b22e73b6050cbea5a1d1710474cdcda39d0d9e207a1dabb60ae430e7a4e2392272b8d7e91741a4390f89657fd41b2e644153769d09eed9b61876a4a7b77166",
"enc": "04f5b22e73b6050cbea5a1d1710474cdcda39d0d9e207a1dabb60ae430e7a4e2392272b8d7e91741a4390f89657fd41b2e644153769d09eed9b61876a4a7b77166",
"ikmR": "01e6a31592cdb561760965669c453c12b8e0feb70fa73267ca5071a67fa4ffe4",
"skRm": "7c6ae8a1ef902bb0d9b5a7e1283d046970d4181ac3b744d8c9a471ced7ac2b24",
"pkRm": "04b7ee178b04df46a09ab4259d551f2d21f3cd69d6ae03d0f491177aaaa3bccc28849506f7f426ed67f4e1c6e12c385c17140765ef5646af821f97f954f05c0613",
"shared_secret": "4587f2880b50184847f4e74f237f608c4c3821c16ba18d909e3cb2f04f73df63",
"key_schedule_context": "",
"secret": "",
"key": "5dd9cb6c744727bb6bc0b21c98e55e3f",
"base_nonce": "384ba8b643938841034d978f",
"exporter_secret": "66c6a00fd170192358866776800c295416771932ad82e5f780e623258a4ff4fe",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "d7306d0a1fd86999ef883c941e02c4975ec29f00",
"ikmE": "521029f944906302688dc165f61c3d75eaabcf96f26a30251e7d14f7d2162ff1",
"skEm": "b9b79736c1e17734d3f8d212786a038791c0189a000e4d575056e55ee1e46054",
"pkEm": "04ae021bcdc823096bd7f3cf14b39f4718e5be40ea8312b01af7adc217ac3ff19e538ad0b6a7be9737228d9730855f0f29ebbf0c34005a586e7556a636b0836f8d",
"enc": "04ae021bcdc823096bd7f3cf14b39f4718e5be40ea8312b01af7adc217ac3ff19e538ad0b6a7be9737228d9730855f0f29ebbf0c34005a586e7556a636b0836f8d",
"ikmR": "f4027ea850c3b82daeddf7697e86be92ebb276a10b1eab7748acc024ca5d2c56",
"skRm": "b94abd6542c300051737cc7eb324f5d04310fd329caa22ca30612e4f46bee3ef",
"pkRm": "04d390f6ff008e96bab5ad35f25d543d6760f65608e799e268f472f0772145baeeb03f4e8edc6fe1c638da86d0301b5d044f51a5d2975efb6083fda69dde6b4854",
"shared_secret": "c879be0bba5934a054b44c13acd489d6b5be2b9ef37ad683ad08c2946e3a40cb",
"key_schedule_context": "",
"secret": "",
"key": "e436ac946f4d01edb49780bc75b5784c",
"base_nonce": "14b3d065afc24c2205808d88",
"exporter_secret": "579bedf120431519f6f82ccdd1cb16ef0fc2460db1f7d38bee0907bd4b55ad5d",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 2,
"info": "b546c00cece2e2ff0815eb0f8124fb9028c66e80",
"ikmE": "41233637379f346f4e70e9ca44c31e7ee284d42a5bfd72572ae8884a09aa355e",
"skEm": "8979ee752423d020085c75cce1644959f819464a4c1c4e9a28ce4dd482991c1c",
"pkEm": "040de7712da136d40779452a32e70ec834fa092ee8e3f26450786c6cd51396e8596c958065594d30432e812fc7a53a10d7fce2ce9bf52ccce72cbad4c79d3b17f6",
"enc": "040de7712da136d40779452a32e70ec834fa092ee8e3f26450786c6cd51396e8596c958065594d30432e812fc7a53a10d7fce2ce9bf52ccce72cbad4c79d3b17f6",
"ikmR": "323c89b1ca03ca9c4ac6316d02f4604f2f6804665a13d8635786281f00f18006",
"skRm": "024be5fda9036a2d81f8c634193b5ce83e65bfc4373ae8b7a960fea8770d1f8f",
"pkRm": "040986ec455812ddd870414c2753f75dadaefda155bc7bd18c4ab6ff3dd61b2ea3bee4ab2a0160b8e330757fc6d81d88ece7051bd9a07fa7e5368ea579e2e6c0e6",
"shared_secret": "ad889cd7b11e8881252f8f12539be9f5e36d2b95c96c875fb0e449c711e8bc0d",
"key_schedule_context": "",
"secret": "",
"key": "da2f3e53e24306c97331e92f564b6c207246e9ab4dea07a472401702d0af5c53",
"base_nonce": "d4d0dcfeeb6767d808f319e4",
"exporter_secret": "3edae43083bb52033f9ff2eea2bf5a8bdc8bbd5509e5958b09c477b32d2432ae",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 2,
"info": "237b97992f7d59a4fa96f628b6ddb8d8fe9b74ef",
"ikmE": "e94e2130878a3afb37d7a8447e7f8c3b83036c842c34710a46bc125cdb67207d",
"skEm": "4ec1abbf0a8b5a8193f800f937c5d2f3dba07b21d787c273d5a04a3ca36d2ae2",
"pkEm": "04ec5d5055fef3d087b945edd7b7929ca654ac7f28125abbfcd10b8c1611e2290aa807451086f66ae9346c5bfeda63b098166dbee3851c0e5e0d798ecb4b1ab00b",
"enc": "04ec5d5055fef3d087b945edd7b7929ca654ac7f28125abbfcd10b8c1611e2290aa807451086f66ae9346c5bfeda63b098166dbee3851c0e5e0d798ecb4b1ab00b",
"ikmR": "b93e2e31319435db36e3f59a7b27743d2beb3cc5c782d0cea69521d403b0e0c5",
"skRm": "92fe8b8b8e343dd483227c8fbe3b6c400b995c427464a46c9529f0b23bcf7640",
"pkRm": "0423b3a51484936f310bd30ee7ca6d8ddd2c218fa706877165445b1d852676b285ca4162e704a2595d4b6f7fc411d1c2610ef3a64b8b318c797787b73b1008c1e8",
"shared_secret": "ac59cd63169bf1a7dee04c3826de9620bea20439ae0014a6aef019d9c2f908a3",
"key_schedule_context": "",
"secret": "",
"key": "75ad242135d5592bd3f903a248ce1c76b1059011a1110cb080223190b47bb1c4",
"base_nonce": "d9b549e5777926737decd367",
"exporter_secret": "cfa9e09c696d5b277a82576822f160a8e0154ac165c9dcfe6ad4b99fe14b5933",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 2,
"info": "a2bb7b11f256061eaff55351e70f6feb1b584c05",
"ikmE": "8eaaded2e37e7ce4f15d161a6b0df3b83314c04238c7f766553f7c9f6710f700",
"skEm": "efcf9e3ae3eb2e16dc93f69cfb1049e7e5fdb15a72e7a3d75ba67f5533fce2de",
"pkEm": "0454d07e51db25cfdaabcfcb9899058556bc2d5368ecf670232f82501fdfb701fc85825be30bb0e6942eb4e9957efcf8b5118ed5508c0ae7dde01dbdbfb21f43d6",
"enc": "0454d07e51db25cfdaabcfcb9899058556bc2d5368ecf670232f82501fdfb701fc85825be30bb0e6942eb4e9957efcf8b5118ed5508c0ae7dde01dbdbfb21f43d6",
"ikmR": "6590a304421bb59ec56fe898a9c551f31ae24ac2b342200cd16ff338f6142065",
"skRm": "bd8150f2eb51c76d9651849cb9447d91282290d50a7cbe15cbea20f8b79e3430",
"pkRm": "04dbbeff50553f1b320862e4eb5d7a695fd0237cedaabbe458ca3bd12154d5c2579dc94ff3eb6d160076f1569354be758db949dc78176e5b59c6605dd4e799d946",
"shared_secret": "df215ff78aa76de1e4ca71498295008da4db44899625423bb4f4c2fcd49f89e4",
"key_schedule_context": "",
"secret": "",
"key": "271e4c0be542d8b2240d53a3624052f4fcf7105870106b633478d00c052f5ec7",
"base_nonce": "1dbe7972d32c82968c616b80",
"exporter_secret": "0e5e5d69f8700632e14be0904eb145f619535fccfbddf3845c0072aeac376159",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 3,
"info": "609dcb9844f8412343191f93add1177186c03a36",
"ikmE": "77caf1617fb3723972a56cd2085081c9f66baae825ce5f363c0a86ec87013fa0",
"skEm": "1300156862599d00ecbb066644bf4d4505b56a9b235eae7a8632defc4335d5c0",
"pkEm": "0471788be0ccf916302c4f2225bba89a0ff3832df1fe50b48d8ccb910be74e30241428ba6de731ccf538ded2913febdfe14b2648fafb8fdd35b8aa91804c706076",
"enc": "0471788be0ccf916302c4f2225bba89a0ff3832df1fe50b48d8ccb910be74e30241428ba6de731ccf538ded2913febdfe14b2648fafb8fdd35b8aa91804c706076",
"ikmR": "71b530bed75fc3fa2f8e8bb163203e6ee676565cc61cd59d66352676341c0688",
"skRm": "4a99cf59fb6af25c324299a39fef2db3931667ee89528e3aacc8b61d591ad643",
"pkRm": "04e660b55a28899c472ca023dce35f23da3cf16677dbdce9ed25353bd8b70cbb8bee0abd2cc8936aee263a08d5b2a15d29a16d12b75fda63b9c614c477af165e2d",
"shared_secret": "a81a3ccf56f48c699eb9f393e0701692836f9ac2e06b493ccbf99ac68a792bbe",
"key_schedule_context": "",
"secret": "",
"key": "4c260fe82e8c3737e7a70c3223cb16fc205682255389ad4bc3e7fae42c46b062",
"base_nonce": "e035bbf3c39ff5a7196cfe84",
"exporter_secret": "83e82aad90186ddd7e1db090c840ee70eb6cac7531b64dc52a12997462c8d0d8",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 3,
"info": "325c816adeee49bea410f0db92947892378f6e0c",
"ikmE": "597ba1fe9a4db02225bbb3e4cd150ceb68636e84d80e728f1be6b22e8aeefcb0",
"skEm": "29e4ff54b558f0a5b3c8f7c016736f6b784ed71d1395bbee07ae4320919465d1",
"pkEm": "04a3f4964462ee117c47ed7c129ce25c574d1cd97aa2fde60abdb8616be0f5c1a6fe12c847b07ffca907c8e3f7eb58fe94042b78a90f27318d5421e96af9acab7a",
"enc": "04a3f4964462ee117c47ed7c129ce25c574d1cd97aa2fde60abdb8616be0f5c1a6fe12c847b07ffca907c8e3f7eb58fe94042b78a90f27318d5421e96af9acab7a",
"ikmR": "9cabb8ddac5293c96ffcdaa3aa1c797ecba36f9c2d21ce27495f52ea80497a5c",
"skRm": "dad1397389c4ff7fa014068bcfbf0c2ea2e24d78b0395fa3de9e88802bc8a684",
"pkRm": "04be3e5d3dfcc77e81f96f90c5fa3ce7f6f7f7005acaf39a2c3d7d47f1ac1cf10bcd06191d07366e706a2ca77e2e0571e11bfc2cbd471904ef0d999af757939da1",
"shared_secret": "9edafcdb619dabc578d8f7b7b055ac66d5cfb6219b90f69d13d297ed49f3aaf3",
"key_schedule_context": "",
"secret": "",
"key": "6e771cd99a23e82ddbd972ecc1b7d3bcd5d6f961370ac2ff785e6776b47b2d53",
"base_nonce": "208b33e382b39dfc1ebb2c95",
"exporter_secret": "ead4fa0d88885cc36792039cbf75110d57eac32e883395eae3ccdeba0a53b3d4",
"encryptions": [],
"exports": []
},
{
"mode": 0,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 3,
"info": "5d274e2436d921573ba466fb5ebef86bd5f77f34",
"ikmE": "149db0ca6bd0bdabbfca4a61c4a6507efff33eedd844d9e1c299cbaab3a1d006",
"skEm": "a342069714f97f18a844495779cf41e82ffa7e98c197ffd1276a8d74823c2519",
"pkEm": "0460cb3f0f85591f7b804fe91882b442837b9b535ea9c9fbd2d3adda128967d9374ba8c7da87e8af31a32a326da570bc96044a731e1857246b881051b8d86779ea",
"enc": "0460cb3f0f85591f7b804fe91882b442837b9b535ea9c9fbd2d3adda128967d9374ba8c7da87e8af31a32a326da570bc96044a731e1857246b881051b8d86779ea",
"ikmR": "2d00ee3b22d16bd33224c2cd32158437bd0e0e3c053307d697b70e55f578f009",
"skRm": "1ef5ec4b4482951fca257b0a0709f376f08c30a647cefa10f9b150a6839385ff",
"pkRm": "04706fd6e62dbf8a440f9f77bc47eb0703177f0f80275ce4be175c9c869536779a64806dff22c83ceb9b4a87302415a161b7d30a55521d181a6d01974c0648773e",
"shared_secret": "fffa60534552d71101540d8022cd1ffe896da801fe55e194b9d71f1ce882b6ff",
"key_schedule_context": "",
"secret": "",
"key": "ebe85898642db23679f83ae4a81efdea5feb4103553b9834cb1f4f602bcef495",
"base_nonce": "ea1e6ce9451d45f9295189c2",
"exporter_secret": "92ea7629022c39382b333c1dcdc2dbed9cd2de4fe1d57320125577231aa35203",
"encryptions": [],
"exports": []
},
{
"mode": 2,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "70aa544b76a9d75a2b98682243489b1a2a315cc2",
"ikmE": "4c74b4c2bf105ba4390c23399b43a0f08de95686133e90288deafcea786f313e",
"skEm": "be124a18ba7956629489da30493aae91a51ad2bd1a41f34b39ec6b28de946576",
"pkEm": "048f1100da3b5413c417e224262b45f146884e21691c0ffff11cd04a762598c5e739f8c5d460a328de39c94a1ab922c9419be89cc36d262cb7ce8a28f850f8e8ff",
"enc": "048f1100da3b5413c417e224262b45f146884e21691c0ffff11cd04a762598c5e739f8c5d460a328de39c94a1ab922c9419be89cc36d262cb7ce8a28f850f8e8ff",
"ikmR": "f3dc9707eac8feb1a86c96279e23318fae9f3e2c04aca5ca9e2ace204488bd35",
"skRm": "040fc95447fff5a811321da69ff4655d185d58edef93453ab23dfb1be2f02702",
"pkRm": "04a3935d9f2ea9c4b23cdf49f4761625b2acbc1fc89532fe2c3af9d1b1c61b9f167f61ba6125d47151df26e2ecfa851bd79719c99ff354c9b9e9619f25cb6ba6d7",
"ikmS": "f3dc9707eac8feb1a86c96279e23318fae9f3e2c04aca5ca9e2ace204488bd35",
"skSm": "040fc95447fff5a811321da69ff4655d185d58edef93453ab23dfb1be2f02702",
"pkSm": "04a3935d9f2ea9c4b23cdf49f4761625b2acbc1fc89532fe2c3af9d1b1c61b9f167f61ba6125d47151df26e2ecfa851bd79719c99ff354c9b9e9619f25cb6ba6d7",
"shared_secret": "a2dad1b68920ce1052742b1f293d819735a6486a2ebe7443a6551059a538bfdc",
"key_schedule_context": "",
"secret": "",
"key": "56fe074940f495dc98c84b6328be4ebc",
"base_nonce": "86a7381e39a2385c9a1c3118",
"exporter_secret": "e0abbed4f7753f450466fa5e4d37fe32ee72c5b17b0ec8de79d1437b49646ac2",
"encryptions": [],
"exports": []
},
{
"mode": 2,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "1d49ad98eb394f251ca6ae5c0badb0573c85bcfd",
"ikmE": "769a0a841620dd1dbe74b394259ff53c8921a18cd839dd1dfc689efb6f0a50df",
"skEm": "22ce73fde1d929fa60debc5e09bde0dc05a84657c550d62a864b422b00e6ddca",
"pkEm": "0418faf0d455e8b565932bba553517f2e5648ab5caa96f3cde6e536f516dfaee9752a3a0b7495c87157540f760e4da15905c40a5fad8844b439cd50161a5fa01b5",
"enc": "0418faf0d455e8b565932bba553517f2e5648ab5caa96f3cde6e536f516dfaee9752a3a0b7495c87157540f760e4da15905c40a5fad8844b439cd50161a5fa01b5",
"ikmR": "a19c255f687911e217deac27b4719003010c98fae415b7e1247f09357bdf8f10",
"skRm": "231b758bae09399a9c4933e314e65d30c6df2e735f4d8e0a3165e5cdd2ff0ea7",
"pkRm": "0470b0633389d768176915fd0e1ee091ad8f8c1eb2e31a11f11896a0ddb38bc16abb1bfe5c171517544bfd748d482a2ed373d6ecbd2da0f03a790601af33ad8684",
"ikmS": "a19c255f687911e217deac27b4719003010c98fae415b7e1247f09357bdf8f10",
"skSm": "231b758bae09399a9c4933e314e65d30c6df2e735f4d8e0a3165e5cdd2ff0ea7",
"pkSm": "0470b0633389d768176915fd0e1ee091ad8f8c1eb2e31a11f11896a0ddb38bc16abb1bfe5c171517544bfd748d482a2ed373d6ecbd2da0f03a790601af33ad8684",
"shared_secret": "92bb5f23fa0ff749330cb744af8ab7b99e89c721e623ef70e37a6d7674453935",
"key_schedule_context": "",
"secret": "",
"key": "35b7fd94f255eb4c760b2388c513bd7b",
"base_nonce": "1d960dd240d63fa036c34956",
"exporter_secret": "b9d96dbff3ea25237adee470214d26f6033db829e5e8cd74de0c97e1ddc41293",
"encryptions": [],
"exports": []
},
{
"mode": 2,
"kem_id": 22,
"kdf_id": 1,
"aead_id": 1,
"info": "8820687431c25b9b93bfa0b397bc1ab2f0dfe94f",
"ikmE": "0b4aed6b990fe00241d80c0bc417c08e3ebd9468371b1b96dc938c9ee2fb4a6c",
"skEm": "e8d53705b5fc12b6d37c30a2b0b8ec2cead7ecaa413cf98d88884837b4adb41a",
"pkEm": "04336072155d3ece3a03a18508e9196fb4ee31768a00858ad157b493dff9a81c476e83faa94252d2cba58ec2cca9aa157e292e73e86b0603930d86f38fe5453f68",
"enc": "04336072155d3ece3a03a18508e9196fb4ee31768a00858ad157b493dff9a81c476e83faa94252d2cba58ec2cca9aa157e292e73e86b0603930d86f38fe5453f68",
"ikmR": "73740fb056be371fe34c0e638d766c0553e80a10b325145aa73694b899932522",
"skRm": "995c9a7bb1e0f85b01734b966fc6e41281aaac32b7142ad18c8aacd7215d6619",
"pkRm": "04382f87d0d37c7fc59f2831f60b90565feaacfab11facb3d902056dd18159281b948028a2fecffa4eda96c365a3b3a0852fa8bafb64863a369b0c954e3ac8f6a1",
"ikmS": "73740fb056be371fe34c0e638d766c0553e80a10b325145aa73694b899932522",
"skSm": "995c9a7bb1e0f85b01734b966fc6e41281aaac32b7142ad18c8aacd7215d6619",
"pkSm": "04382f87d0d37c7fc59f2831f60b90565feaacfab11facb3d902056dd18159281b948028a2fecffa4eda96c365a3b3a0852fa8bafb64863a369b0c954e3ac8f6a1",
"shared_secret": "c7ef717fb680bd421bd36279228a4c164f8ea860846fb779afee15ca7596c1f7",
"key_schedule_context": "",
"secret": "",
"key": "a4430c9849caddeadac9e36619572984",
"base_nonce": "cee547962ec2914771d81fad",
"exporter_secret": "09db3c29fc8c1889965ea252352dc6c805ba74bcb761a1e2e4903d03002ce773",
"encryptions": [],
"exports": []
}
]
27 changes: 0 additions & 27 deletions tests/k256_auth.json

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_hpke_kat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ fn kat<Crypto: HpkeCrypto + 'static>(tests: Vec<HpkeTestVector>) {
#[test]
fn test_kat() {
let _ = pretty_env_logger::try_init();
let file = "tests/test_vectors.json";
let file = "tests/k256.json";
let file = match File::open(file) {
Ok(f) => f,
Err(_) => panic!("Couldn't open file {}.", file),
Expand Down

0 comments on commit 9fbbcde

Please sign in to comment.