diff options
author | Pieter Wuille <pieter@wuille.net> | 2023-07-10 10:58:20 -0400 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2023-07-26 17:09:27 -0400 |
commit | 1c7582ead6e1119899922041c1af2b4169b0bc74 (patch) | |
tree | 62b62595c6148afa1ef56d0ccd4ba5d1c36a9aa7 /src/bip324.h | |
parent | 990f0f8da92a2d11828a7c05ca93bf0520b2a95e (diff) |
tests: add decryption test to bip324_tests
Diffstat (limited to 'src/bip324.h')
-rw-r--r-- | src/bip324.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bip324.h b/src/bip324.h index 1738356ee5..8d025c2ee3 100644 --- a/src/bip324.h +++ b/src/bip324.h @@ -52,8 +52,12 @@ public: /** Retrieve our public key. */ const EllSwiftPubKey& GetOurPubKey() const noexcept { return m_our_pubkey; } - /** Initialize when the other side's public key is received. Can only be called once. */ - void Initialize(const EllSwiftPubKey& their_pubkey, bool initiator) noexcept; + /** Initialize when the other side's public key is received. Can only be called once. + * + * self_decrypt is only for testing, and swaps encryption/decryption keys, so that encryption + * and decryption can be tested without knowing the other side's private key. + */ + void Initialize(const EllSwiftPubKey& their_pubkey, bool initiator, bool self_decrypt = false) noexcept; /** Determine whether this cipher is fully initialized. */ explicit operator bool() const noexcept { return m_send_l_cipher.has_value(); } |