From 79cbd2c9bcf2f9e2c750f3d68cd6303e0b9536e7 Mon Sep 17 00:00:00 2001 From: dhruv <856960+dhruv@users.noreply.github.com> Date: Tue, 1 Mar 2022 16:34:06 -0800 Subject: [PATCH] test: BIP324 authenticated encryption test vectors --- src/test/net_tests.cpp | 234 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/src/test/net_tests.cpp b/src/test/net_tests.cpp index 7ae881e510..535acd9a19 100644 --- a/src/test/net_tests.cpp +++ b/src/test/net_tests.cpp @@ -1071,4 +1071,238 @@ BOOST_AUTO_TEST_CASE(bip324_derivation_test) SelectParams(CBaseChainParams::REGTEST); } +struct P2PV2Peer { + CKey key; + std::array ellswift_r32; + EllSwiftPubKey expected_ellswift; + std::vector plaintext; + std::vector ciphertext_mac_0; + std::vector ciphertext_mac_999; +}; + +struct P2PV2TestVector { + P2PV2Peer initiator; + P2PV2Peer responder; + ECDHSecret expected_ecdh_secret; + BIP324Keys expected_bip324_keys; +}; + +#define PARSE_HEX_COPY(X, Y) \ + parsed_hex = ParseHex(X); \ + memcpy(Y.data(), parsed_hex.data(), parsed_hex.size()) + +P2PV2TestVector parse_test_vector(const char* initiator_privkey, const char* responder_privkey, + const char* initiator_ellswift_r32, const char* responder_ellswift_r32, + const char* initiator_ellswift, const char* responder_ellswift, + const char* shared_ecdh_secret, + const char* initiator_L, const char* initiator_P, + const char* responder_L, const char* responder_P, + const char* session_id, + const char* rekey_salt, + const char* garbage_terminator, + const char* initiator_plaintext, + const char* initiator_ciphertext_mac_0, const char* initiator_ciphertext_mac_999, + const char* responder_plaintext, + const char* responder_ciphertext_mac_0, const char* responder_ciphertext_mac_999) { + P2PV2TestVector ret; + auto parsed_hex = ParseHex(initiator_privkey); + ret.initiator.key.Set(parsed_hex.begin(), parsed_hex.end(), false); + parsed_hex = ParseHex(responder_privkey); + ret.responder.key.Set(parsed_hex.begin(), parsed_hex.end(), false); + + PARSE_HEX_COPY(initiator_ellswift_r32, ret.initiator.ellswift_r32); + PARSE_HEX_COPY(responder_ellswift_r32, ret.responder.ellswift_r32); + PARSE_HEX_COPY(initiator_ellswift, ret.initiator.expected_ellswift); + PARSE_HEX_COPY(responder_ellswift, ret.responder.expected_ellswift); + PARSE_HEX_COPY(shared_ecdh_secret, ret.expected_ecdh_secret); + PARSE_HEX_COPY(initiator_L, ret.expected_bip324_keys.initiator_L); + PARSE_HEX_COPY(initiator_P, ret.expected_bip324_keys.initiator_P); + PARSE_HEX_COPY(responder_L, ret.expected_bip324_keys.responder_L); + PARSE_HEX_COPY(responder_P, ret.expected_bip324_keys.responder_P); + PARSE_HEX_COPY(session_id, ret.expected_bip324_keys.session_id); + PARSE_HEX_COPY(rekey_salt, ret.expected_bip324_keys.rekey_salt); + ret.expected_bip324_keys.garbage_terminator.resize(BIP324_GARBAGE_TERMINATOR_LEN); + PARSE_HEX_COPY(garbage_terminator, ret.expected_bip324_keys.garbage_terminator); + ret.initiator.plaintext = ParseHex(initiator_plaintext); + ret.initiator.ciphertext_mac_0 = ParseHex(initiator_ciphertext_mac_0); + ret.initiator.ciphertext_mac_999 = ParseHex(initiator_ciphertext_mac_999); + ret.responder.plaintext = ParseHex(responder_plaintext); + ret.responder.ciphertext_mac_0 = ParseHex(responder_ciphertext_mac_0); + ret.responder.ciphertext_mac_999 = ParseHex(responder_ciphertext_mac_999); + + return ret; +} + +void bip324_assert_test_vector(const P2PV2TestVector& tv) { + auto initiator_ellswift = tv.initiator.key.EllSwiftEncode(tv.initiator.ellswift_r32).value(); + BOOST_CHECK_EQUAL(HexStr(initiator_ellswift), HexStr(tv.initiator.expected_ellswift)); + + auto responder_ellswift = tv.responder.key.EllSwiftEncode(tv.responder.ellswift_r32).value(); + BOOST_CHECK_EQUAL(HexStr(responder_ellswift), HexStr(tv.responder.expected_ellswift)); + + auto initiator_ecdh_secret = tv.initiator.key.ComputeBIP324ECDHSecret( + MakeByteSpan(responder_ellswift), MakeByteSpan(initiator_ellswift), true).value(); + auto responder_ecdh_secret = tv.responder.key.ComputeBIP324ECDHSecret( + MakeByteSpan(initiator_ellswift), MakeByteSpan(responder_ellswift), false).value(); + BOOST_CHECK_EQUAL(HexStr(initiator_ecdh_secret), HexStr(responder_ecdh_secret)); + BOOST_CHECK_EQUAL(HexStr(initiator_ecdh_secret), HexStr(tv.expected_ecdh_secret)); + + BIP324Keys v2_keys; + DeriveBIP324Keys(std::move(initiator_ecdh_secret), v2_keys); + + BOOST_CHECK_EQUAL(HexStr(v2_keys.initiator_L), HexStr(tv.expected_bip324_keys.initiator_L)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.initiator_P), HexStr(tv.expected_bip324_keys.initiator_P)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.responder_L), HexStr(tv.expected_bip324_keys.responder_L)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.responder_P), HexStr(tv.expected_bip324_keys.responder_P)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.session_id), HexStr(tv.expected_bip324_keys.session_id)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.rekey_salt), HexStr(tv.expected_bip324_keys.rekey_salt)); + BOOST_CHECK_EQUAL(HexStr(v2_keys.garbage_terminator), HexStr(tv.expected_bip324_keys.garbage_terminator)); + + auto initiator_suite = BIP324CipherSuite(v2_keys.initiator_L, v2_keys.initiator_P, v2_keys.rekey_salt); + BIP324HeaderFlags flags{BIP324_NONE}; + std::vector ciphertext_mac; + ciphertext_mac.resize(BIP324_LENGTH_FIELD_LEN + BIP324_HEADER_LEN + tv.initiator.plaintext.size() + RFC8439_TAGLEN); + for (int i = 0; i < 1000; i++) { + BOOST_CHECK(initiator_suite.Crypt(MakeByteSpan(tv.initiator.plaintext), MakeWritableByteSpan(ciphertext_mac), flags, true)); + if (i == 0) { + BOOST_CHECK_EQUAL(HexStr(ciphertext_mac), HexStr(tv.initiator.ciphertext_mac_0)); + } else if (i == 999) { + BOOST_CHECK_EQUAL(HexStr(ciphertext_mac), HexStr(tv.initiator.ciphertext_mac_999)); + } + } + + auto responder_suite = BIP324CipherSuite(v2_keys.responder_L, v2_keys.responder_P, v2_keys.rekey_salt); + ciphertext_mac.resize(BIP324_LENGTH_FIELD_LEN + BIP324_HEADER_LEN + tv.responder.plaintext.size() + RFC8439_TAGLEN); + for (int i = 0; i < 1000; i++) { + BOOST_CHECK(responder_suite.Crypt(MakeByteSpan(tv.responder.plaintext), MakeWritableByteSpan(ciphertext_mac), flags, true)); + if (i == 0) { + BOOST_CHECK_EQUAL(HexStr(ciphertext_mac), HexStr(tv.responder.ciphertext_mac_0)); + } else if (i == 999) { + BOOST_CHECK_EQUAL(HexStr(ciphertext_mac), HexStr(tv.responder.ciphertext_mac_999)); + } + } +} + +BOOST_AUTO_TEST_CASE(bip324_vectors_test) +{ + // BIP324 key derivation uses network magic in the HKDF process. We use mainnet + // params here to make it easier for other implementors to use this test as a test vector. + SelectParams(CBaseChainParams::MAIN); + std::array vectors{ + parse_test_vector( + /* initiator_privkey */ "9cdfc7df74056ddebee98e3310026ecb11578cad9c5d09457194cc2162a1973b", + /* responder_privkey */ "2030aaaf44a1437c07c938aa33c58751a6aee0c0e48e285f8031b137f498921d", + /* initiator_ellswift_r32*/ "c1efb3a6738a6d612f5f27dc35959c7e5c7d3ec15ffae3ca3159abd1582e8db7", + /* responder_ellswift_r32 */ "cb9dfe3802ae4caf320971d52f36f284ad88ddb976976cc2deb6bb39d0a79fde", + /* initiator_ellswift */ "9b006371b8ceab1a95e87de3e24022c22946f1949a19baee6de14f3abf2d559a95c385732c3d4cf345d158bf72dfc142093a7708c02e96355c010f456f47422d", + /* responder_ellswift */ "19a4af4fa003a1ea67c0d25771ba90a81a92490a9a19690eab1b8598744c35aa1ade90c6ce36f122ea909c539115e95907488312e30e90d3c519018f5693b664", + /* shared_ecdh_secret */ "5e0dc07ed6de98645ec1032b70694a2b636d42aeafde1687cae16dd2926ce570", + /* initiator_L */ "7ba3e183e3652bcb2323f73d0a75fb3ad2f018b997e8523a274551c0e867b389", + /* initiator_P */ "3a4bbc5ec5d9337f72aa1a28a37497da7d489f8af1f688528a6d18fd8fa3ec92", + /* responder_L */ "e9bdcc3f987700ba706e5221d4916fddbe1272f37f31ef628dd513bf3ee6b11a", + /* responder_P */ "08acf315ac6436656b4977448f53409656d2533138ca3dc856950cbed97287b8", + /* session_id */ "dae5f788cae9d93aa1c1bb44642f32a990540b514cb2c9a5ebb8666ee31f0d92", + /* rekey_salt */ "f59c636f0cf76a6d3d4c9f7a87b304d0135ce96cbacb75756ebc2064f7d69704", + /* garbage_terminator */ "4608d580d3a29e4b", + /* initiator_plaintext */ "9bc0f24442a76af47b9daa9f0c99d41381c0c06698ffc4ad069acf3d20928277433818565904cdd66ea93b1b755a3293d1d154110faa8add3dcafed2328fffea", + /* initiator_ciphertext_mac_0 */ "17e372f875494b907bfc1e8f8ba98462e0314e73e1e1831d03dc736d8a4e3988cea72d240662cea10616111a97abd34370fd028253994b38699b8c16eeb076fabedaacacc2063d3240d71169ad25789a1e8f44e0", + /* initiator_ciphertext_mac_999 */ "45e14631adc990cfac65ed39907d8585019438b3b142c0e2aa13d79aab02ab69c8a6ed65871958dadda569b2bbde2cae3e63b741840b9f978fb95a7d927b5def19c187dcdd345553607a871c88fceada3f4926d6", + /* responder_plaintext */ "2822acbe87f9e1a284f2eaa9a56f948fc0de0c91f342ae541722b758d7956c9a8fe25b082789a2fb5b23da639d05e438461e7fcf92262dbeaeebbacbf01dcfb2", + /* responder_ciphertext_mac_0 */ "c299a1f20f485a6c3f7e2be5e87e0b573dff183883387d05f13eb9eda5786c610949e5390b1377edff5aec69431f0454870ba99560b88cd94488ba4fac3ab8caed138031a80c6b03c484f0d3cedd93c36f1ce10a", + /* responder_ciphertext_mac_999 */ "c5ef55daebf453987327654f06af59f2a75527052e4b3a567a3dd2bd8fdb79e60a634ee04c07d72a75e4ca0dd248538332b8aa46a2c6cb6e0474b063935fae61633a1bd0d1e02e7ef01f584b90be32707b5377de"), + + parse_test_vector( + /* initiator_privkey */ "44e5fe764c43d1f7a60ead0acd0e74a4b14f7b7fc056984a993dede99e04c743", + /* responder_privkey */ "fe6065b12cdfd53b9cd9b55c491063d60abdccc3090d2cdba17bf093fe363f09", + /* initiator_ellswift_r32*/ "f54a836324dcb9c5701c3f73edf96ebfea053a2af1be4e7bb178bf721bad5e4d", + /* responder_ellswift_r32 */ "ef7cd5de28f2b6b77f59ef3b4d00939841e0ab9ab5fdd351e83ce0626c90e866", + /* initiator_ellswift */ "bd439a4b0cdf1a6ec5a3f10acb97ac2fe11d4c10266c24008f8d963ec40c5468b113ab984858531ecd134d716e31ca6f536bc23b4c56439bfd253f3c74c71883", + /* responder_ellswift */ "c6eac141d4740187069e62a07c3549f5e179f676d90a8e333cda843c53127843aa3c5272baae373b3548d2e414c818aeaabc74938059b34c36c915d0e2f08840", + /* shared_ecdh_secret */ "ed18890c03f091ce00b9753962e390a13614bf0e8f0bc768a5f9d8ef078363ec", + /* initiator_L */ "b73922e89f4f95333de7953fdcd4ae671601b57d7f5f0cece45f346c7b01d472", + /* initiator_P */ "98ba3d5d5aa9fbd7ebd7b2dc70f8635b5adee9e150b9dc5d01d1964610c6ddaf", + /* responder_L */ "1369cd52ef1a3b9b12d54e20312400158139bf8948186281f54dda0b78b81388", + /* responder_P */ "e22bcd96351d120ca07906b83d62ba3d82c3850998ae3f083c09fee3061f8c06", + /* session_id */ "757025f0af6004bb340a555620b74c7a43208049c6360976e7e64106e520913b", + /* rekey_salt */ "95672dd61dd8c0872c05b4ad9be64ce4ff690c47c51706626837d93a83e31fd9", + /* garbage_terminator */ "7d224b0263a1b1ec", + /* initiator_plaintext */ "a4874343279f3ca57427a8649833a7d276023e1035f85a7bfe19597055657192b9d2c102c69f0c8b2fdaeb064cc7432e549614e5aef603f9cf41e44a2f0b41b0", + /* initiator_ciphertext_mac_0 */ "9a0331b82b81dc796906c8158abd784ca7fd6df2e4b98eb9c06abc38891d06fe8012c7045308e2cf2d79d9284ee74f1c1a651b6b862d929594fe8510cab742fb4518ff0ecca353f4f87d5e353de53f56bbb5baf3", + /* initiator_ciphertext_mac_999 */ "126918c7eacc92459c91e03d57e94cc83da081fb4d45c828e750bb34c4e19d68a153a58aa0f856e19706f672697f30033abba6ab600136e2c65dea6a4b0e3a75e338797ddcbe9b368b7e814a76ffa4d980749fb0", + /* responder_plaintext */ "dc77639158727bd733b8accc7c4bd27d329653bceace8be353b02fa56dda8598ff52c833e6aa826c9b7458d978490b24e6cd267afe6f4f1f47edf732e6d08beb", + /* responder_ciphertext_mac_0 */ "58ea485fec440722a95a889585c386e9aa732366c4ef48f3e1c99035cbcf6ae13bb4e4119ba41f9a245c9c9defb0994eb361d581c012545bd9c3a3d26be05b30897698037d0d12bfc2f4c6cbeb172957d6758dc0", + /* responder_ciphertext_mac_999 */ "f5b56122f73d7911d1bb07ab7a8de8aff8c765b548115af1101323f1f9c43a10a08097e66cb482ae6bca410cf809fb817926944cd894ab95b4c0e6966ac4f01ea0dfd6c1ca31aa43bae4d549d5e140c1575605f4"), + + parse_test_vector( + /* initiator_privkey */ "2e26264ea126f08b8baa90f394defc2af8e5e1a3392c1cf6456ba7879494cc29", + /* responder_privkey */ "9fc639ee5a340b6d646d3c0ab35e634c565d25d8dde5fa2ca2e79fad07c9a6d5", + /* initiator_ellswift_r32*/ "794d7f24d16def675f37c41277349fc7186bfa38943f3e349fb98a9c28cd92a8", + /* responder_ellswift_r32 */ "2b8e3b215a08098a43604a9f0305a2ec5f5dc0cc624293fc285c6e5f1ad412f9", + /* initiator_ellswift */ "2a5ec3ace440508588d706cbd08ea7bf04b46df6c5bb41c9ca7b07e30fdefc0fb124bb825a4004a56d570860996faba49ad53dd731b27f8482c8eaccc495fcc1", + /* responder_ellswift */ "e979b78addd7cf3534214c67a4e11edc772166162bad7ac5eb4f903300e401f7e85189a75aeb741ce5d8812d7be79c514748018123ee3e5a0f0aa34e1515517a", + /* shared_ecdh_secret */ "8d387f7339b629bb8fcc70db673129b460177be7014302e8c3d1dafe99894127", + /* initiator_L */ "4b34ce68c2db89c7bd66d8f6f9da4dd117121debce914afbd77f6e6f8c664f39", + /* initiator_P */ "652e2745964bb4c4c71af0992e596b9e84a0b80b64ca68476f10c91468628dd7", + /* responder_L */ "5a66ad87f46ce02a2a72f048c048e2000c1d74abe480fcde0195543d46ea6968", + /* responder_P */ "b40fc223e11192940dff8f30fbf7c50660ca1dd670e63bb20198ebff658d7397", + /* session_id */ "68f0864762c2dfa967f561e0c2f58b4cea6d16b6417ebab067c76c83cdfbc955", + /* rekey_salt */ "fcf33266be8c8fb9383d7d9b5b52f9755bbc6ea85f741fbf3998086207a1a78f", + /* garbage_terminator */ "0305e692fc5ef1a2", + /* initiator_plaintext */ "868d3648fbd816c72c54c12f403127503ba305eeb1a65a144009fae2b6e3bea4c76034a88ccee3a3396c69a970b4fff2f381097d33943a0d455f6f3303a4d3dd", + /* initiator_ciphertext_mac_0 */ "5898355087e1364a8e68b354c104b379feb3e9d1802ea92f93ab6a5605229e04f7df5e8ec122fae5d817e073f711855fde1e039f2ce8f6e229f6b52d00434994848fd64bbf9808913e923652abb40e1c0a305356", + /* initiator_ciphertext_mac_999 */ "3e5226ea7b65ca99051d8588efda0b8f09e644e23e25d482b36191e1abed2cb46931459f30002875b3bc3f07f45483268a3d6a21234b752099115c92ce1663f62787dffde265cb0994f59ecb6607c9720af57b93", + /* responder_plaintext */ "ba67e844fa8d7aa6b77dbb1737c3080da7b65c36b219d91da499b2fb58b6e6e711e7d2960ce744d1e15351badf205a829f7b55b74e971e0a9547d88ec3c30686", + /* responder_ciphertext_mac_0 */ "c0210c7c3c6bf360e00ca7c401e6ed730f13d72a79a9f2994e911cce077dd871b331a63c76d394c7a70db0a4033e90cd453e11a19ed77fbff8f1b4a01a03e612afda3973b8eac26e98b5aeebb19eec303890bc34", + /* responder_ciphertext_mac_999 */ "e23d4bffd49a998ce17d00ef71339de5db8db479508892b413bb048f74c266c2055f75486634209b76aa3cdfb3b1f4ac3b8e8d0d471b59c5883fd55228572d4e51395151a9c8c29735b305b03405de9bfd33eb13"), + + parse_test_vector( + /* initiator_privkey */ "a371e20223e60e967233fe079f052aeabd30f6c6781314f3e7c44e049c648b7d", + /* responder_privkey */ "8063aec031db643874c6629942c402e48f7d74abaf97a8faf8d4628010e46ba4", + /* initiator_ellswift_r32*/ "ec23b3eab32028a9981ff20851abdd10846951b88989950cc31565bd9a3cda79", + /* responder_ellswift_r32 */ "546bfd88292d90a9bbf697380c68f017fdf911d20acad6c3c7e900eff0205a83", + /* initiator_ellswift */ "141cbda0eb0435e5a7c7317dc5360eb37932951373f3df0d87ec293f859da12c5cfe0c2271b40669388556825f74cb1d8cb1511831230a388dc27dcc1fb51ee6", + /* responder_ellswift */ "1c8d9559b0ebebf6e6c7a65f21c4aa1db33ece37cae8affab4150894470b2ffcfe2b80be24710896b47e8c47566e652e4a433fea997fbc06d41f2359a47e2fd4", + /* shared_ecdh_secret */ "3eeb92128bf5cd1f5fc2a3cb9861ce494f0459e222de415aa7ad9540783f5cca", + /* initiator_L */ "fb6a950e6563e68901c1c276a09e0d674b2b9fcf97dc42cbbc62d7d634ec32be", + /* initiator_P */ "1efe92b0879572acf9415b5ea18591237a2f6cc4911ce642023add9859c5d0da", + /* responder_L */ "2a76e89562b05193730db946e08476b466314090f59fe0f3ac1c0e38144f2cc4", + /* responder_P */ "ce026f5da4826ffd5d208dd6b92df0baecab4f62d658b6e51ff76af484db46a9", + /* session_id */ "1594caa3ac7fc965423878ba7e2d122eb939260afd570ac579b18ff4097c7f68", + /* rekey_salt */ "42965849bae3504fa916a31e0a4b920fd5a0253659891627efeb4aa15bc81ff5", + /* garbage_terminator */ "9bfaf1cffdb884a7", + /* initiator_plaintext */ "3e7443578c300b7210860c17168c9e11414781f6168710968777b567f1c27165bc8118ef402150549c18de9b567b85d4046fbef91f502f8cf4c298888ddd434b", + /* initiator_ciphertext_mac_0 */ "ff6b0d8a1ff2535c9d866381aaa2e459299416fe4262069775f6bce95686e17140a1a276da95db46ae6342ad6bf1a6814064aec2e2209787ecc3e86dedebf2c825605fdd9427a6026ffa0a30c86ea36355274e41", + /* initiator_ciphertext_mac_999 */ "569373968f5dc974609a6ad5147777f36a70af30cfe0941146c9b0fb8e47fa49a780a9e6372f261d35f141d7f94667f7120ce141d376dc17c3b7d12fe055934fd15019109f9377fae580a9e4b146759c7f72b7a4", + /* responder_plaintext */ "7f6c9fbae0c003bb38ee2e73c31b248d639cc63b0d5d57b05f57c8b82122d61e401af33d481304a7d956b9ca730500890908682b14933cde958bf497cbcbbd45", + /* responder_ciphertext_mac_0 */ "beb6f5490273309aab6d9decacdaaecb5c262e4b0063275c560d6c62049243689dad3aad39b28f0322dc1df96c43856f3ba6828654e77203f1738cce6cf82e5b3d3e6b3907307e8f4adb0b832d204be4d989d920", + /* responder_ciphertext_mac_999 */ "24b664d8cec2f6a5cb2ba25f361790c5ca3a37b297c7509c0040aea1b29942751b936e768123ee1034a74b7510b4dc7fc13ab8a260f6a9e3ef15a4749346b19c025225c49770e1d3d50b49567860d610df805bbe"), + + parse_test_vector( + /* initiator_privkey */ "928861cf12421b8174bce71bdbdf4397213e17977e40116d79fd42372dfce856", + /* responder_privkey */ "1b06ce10bfdeb76e002d370df40120eb0472b432c5f6535d6a47cff44e126255", + /* initiator_ellswift_r32*/ "1f909dc3ba59acbc6d24f589712cba5ac3926d7c8bc79f02316f4d1adb4f1b26", + /* responder_ellswift_r32 */ "8bc6a59833a8e94810665ac0360b8c976d3f6dfec9573ae8333759e7d5fa8af8", + /* initiator_ellswift */ "762f4b6ea5069f5ed6ee7abe37cb6f2c05487412413895cdd4b5c6ded9dade9e9c11019949cbb4ae4a109fca90de116010327c5b863dae85b1b85d2694656e2e", + /* responder_ellswift */ "ad041b394e0819c9da64559351d09405cd434081d9d43137e1dd6727e5f8c7a85b64b19af0a0e401af0daab8928ef3a26634f28b325586d5c9dccd4fa51a70d7", + /* shared_ecdh_secret */ "edc8b3b5adf5c85a08f724c9394d0d5548f06462f6e704562edb765926f92527", + /* initiator_L */ "06e1ad3091643bc8c2f8acc066045f1d8d42947cec636232e3a5e6d880ee8257", + /* initiator_P */ "9dcb817664ee5e725c9d182e72035e40e409e0b46bff55baf7980952dd11b9be", + /* responder_L */ "198ccd518f84e45d06f39d343c416c3394b953106d7b63467c88d7eadb677419", + /* responder_P */ "08a315218a8e7cd20237440a6976857d85b1808f7b55a08f6f7c6dd6f1f087c5", + /* session_id */ "c5422799775adc17436ccfedb664b083642fc4a28c70dab7dbace741b0eff4c5", + /* rekey_salt */ "7b987034a5affae335ca3335758076483227266f7fbeb46145f454f04dedb937", + /* garbage_terminator */ "ca5fdc5479b055a0", + /* initiator_plaintext */ "7ab5826761ecf971d0aeff4c14eed091a206d29ddd84681c206b333bf0e121fcc5f8d45a266ce9ded4f7476edd0ab941c59cf4bca47f9327cf26a78ab4c9e7d6", + /* initiator_ciphertext_mac_0 */ "679a9301e5e8e08071d151f62ce3dc5e8f18c84bc673e102a2395b6ef44286288726cb25b04e2aadfafb36d5c4f507fe516b25e4ee7c770e44693cb32b1348a20c99061f4e9011e67b5acd3ec2f90d5878b1c5db", + /* initiator_ciphertext_mac_999 */ "a793c932d951ffb5712643362bce16f06868af78ca7abd221763ae66cfa2e893fa351678be8efe3a04be64daeb1fa9388890f99ff00f5365ff4448355a4457e0d559ae1dab6c202e20c6593ff983c5202f7592c0", + /* responder_plaintext */ "dee314b076651a31f0e7451f4e0c3cebddeb6ce82d937b14e036cfa8ae8a91d3afd2760351c0c146fe8740874a3e281fb298cb00a1d9e58a1081f173466ceed6", + /* responder_ciphertext_mac_0 */ "479ffc83a60956577f0b8f41c7c17f6caef6a9e5988e56bc86ff9934a7247e364c1fe50067611f27f27b3185ab90a110035eceadd3cf15ea689bb97276847054d1bf62274e7d5620c3463a8f2ddff18993185d54", + /* responder_ciphertext_mac_999 */ "ac0e8bb42dcf4cc36df5abcf2be8d8a41e4d8e7905d5a77ec90cf73790ec631e9b3f331d649398f4974eb784068511f6fb299e2d85cceea7f53878828cc1df26939bb83a0292eab7e14fbaaac24b45570bde5c6b"), + }; + + for (auto tv: vectors) { + bip324_assert_test_vector(tv); + } + SelectParams(CBaseChainParams::REGTEST); +} BOOST_AUTO_TEST_SUITE_END()