BIP324Cipher::Initialize

Initialize when the other side's public key is received. Can only be called once.

Synopsis

Declared in <bip324.h>

void
Initialize(
    EllSwiftPubKey const& their_pubkey,
    bool initiator,
    bool self_decrypt = false) noexcept;

Description

initiator is set to true if we are the initiator establishing the v2 P2P connection. 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.

Parameters

NameDescription
their_pubkeyThe other side's ElligatorSwift-encoded public key.
initiatorTrue if we initiated the v2 P2P connection.
self_decryptTesting only; swaps the encryption and decryption keys.