[#BIP324Cipher-Initialize]
= xref:BIP324Cipher.adoc[BIP324Cipher]::Initialize
:relfileprefix: ../
:mrdocs:

Initialize when the other side&apos;s public key is received&period; Can only be called once&period;

== Synopsis

Declared in `&lt;bip324&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
Initialize(
    xref:EllSwiftPubKey.adoc[EllSwiftPubKey] const& their&lowbar;pubkey,
    bool initiator,
    bool self&lowbar;decrypt = false) noexcept;
----

== Description

initiator is set to true if we are the initiator establishing the v2 P2P connection&period; self&lowbar;decrypt is only for testing, and swaps encryption&sol;decryption keys, so that encryption and decryption can be tested without knowing the other side&apos;s private key&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *their&lowbar;pubkey*
| The other side&apos;s ElligatorSwift&hyphen;encoded public key&period;
| *initiator*
| True if we initiated the v2 P2P connection&period;
| *self&lowbar;decrypt*
| Testing only&semi; swaps the encryption and decryption keys&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
