Amarula.Protocol.Signal.Group.SenderMessageKey (amarula v0.1.0)

View Source

Represents a sender message key for group encryption.

Each message in a group uses a unique key derived from the sender chain key. This key is used for both encryption and decryption of individual messages.

Summary

Functions

Gets the cipher key for encryption/decryption.

Gets the iteration number.

Gets the IV for encryption/decryption.

Gets the seed used to derive this key.

Creates a new SenderMessageKey from iteration and seed.

Types

t()

@type t() :: %Amarula.Protocol.Signal.Group.SenderMessageKey{
  cipher_key: binary(),
  iteration: non_neg_integer(),
  iv: binary(),
  seed: binary()
}

Functions

get_cipher_key(sender_message_key)

@spec get_cipher_key(t()) :: binary()

Gets the cipher key for encryption/decryption.

get_iteration(sender_message_key)

@spec get_iteration(t()) :: non_neg_integer()

Gets the iteration number.

get_iv(sender_message_key)

@spec get_iv(t()) :: binary()

Gets the IV for encryption/decryption.

get_seed(sender_message_key)

@spec get_seed(t()) :: binary()

Gets the seed used to derive this key.

new(iteration, seed)

@spec new(non_neg_integer(), binary()) :: t()

Creates a new SenderMessageKey from iteration and seed.

Mirrors libsignal sender-message-key.ts: HKDF(seed, zeros32, "WhisperGroup") → derivative blocks D0, D1; iv = D0[0..15], cipher_key = D0[16..31] ++ D1[0..15].