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

View Source

Represents a sender chain key for group encryption.

The sender chain key is used to derive message keys for sequential messages. Each iteration produces a new message key and advances the chain.

Summary

Functions

Gets the current iteration number.

Generates the next chain key in the sequence.

Gets the seed used to derive keys.

Generates a message key for the current iteration.

Creates a new SenderChainKey.

Checks if this chain key is valid.

Types

t()

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

Functions

get_iteration(sender_chain_key)

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

Gets the current iteration number.

get_next(sender_chain_key)

@spec get_next(t()) :: t()

Generates the next chain key in the sequence.

get_seed(sender_chain_key)

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

Gets the seed used to derive keys.

get_sender_message_key(sender_chain_key)

@spec get_sender_message_key(t()) ::
  Amarula.Protocol.Signal.Group.SenderMessageKey.t()

Generates a message key for the current iteration.

new(iteration, seed)

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

Creates a new SenderChainKey.

valid?(sender_chain_key)

@spec valid?(t()) :: boolean()

Checks if this chain key is valid.