The BIP324 packet cipher, encapsulating its key derivation, stream cipher, and AEAD.

Synopsis

Declared in <bip324.h>

class BIP324Cipher;

Member Functions

Name

Description

BIP324Cipher [constructor]

Constructors

Decrypt

Decrypt a packet. Only after Initialize().

DecryptLength

Decrypt the length of a packet. Only after Initialize().

Encrypt

Encrypt a packet. Only after Initialize().

GetOurPubKey

Retrieve our public key.

GetReceiveGarbageTerminator

Get the expected Garbage Terminator to receive. Only after Initialize().

GetSendGarbageTerminator

Get the Garbage Terminator to send. Only after Initialize().

GetSessionID

Get the Session ID. Only after Initialize().

Initialize

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

operator bool

Determine whether this cipher is fully initialized.

Static Data Members

Name

Description

EXPANSION

Total ciphertext expansion added to each packet.

GARBAGE_TERMINATOR_LEN

Length in bytes of a garbage terminator.

HEADER_LEN

Length in bytes of the per‐packet header.

IGNORE_BIT

Header bit signalling that a packet should be ignored by the receiver.

LENGTH_LEN

Length in bytes of the encrypted packet‐length field.

REKEY_INTERVAL

Number of packets between automatic key rotations.

SESSION_ID_LEN

Length in bytes of the derived session ID.

Created with MrDocs