Amarula.Protocol.Signal.Group.SenderKeyMessage (amarula v0.1.0)
View SourceSender key message for group encryption, ported from
src/Signal/Group/sender-key-message.ts.
Wire format: [version byte][Proto.SenderKeyMessage][64-byte XEd25519 sig]
where version = (3 << 4) | 3 = 0x33 and the signature is XEd25519
(Curve25519 keys, same scheme as the identity key) over version + protobuf.
Summary
Functions
Creates a SenderKeyMessage from serialized bytes.
Gets the ciphertext.
Gets the iteration.
Gets the key ID.
Gets the message type.
Creates a new SenderKeyMessage, signing with the Curve25519 private
signature_key.
Serializes the message to binary.
Verifies the XEd25519 signature against the Curve25519 public signature_key
(raw 32 bytes or 0x05-prefixed 33 bytes).
Types
@type t() :: %Amarula.Protocol.Signal.Group.SenderKeyMessage{ ciphertext: binary(), iteration: non_neg_integer(), key_id: non_neg_integer(), message_version: non_neg_integer(), serialized: binary(), signature: binary() }
Functions
Creates a SenderKeyMessage from serialized bytes.
Gets the ciphertext.
@spec get_iteration(t()) :: non_neg_integer()
Gets the iteration.
@spec get_key_id(t()) :: non_neg_integer()
Gets the key ID.
@spec get_type(t()) :: non_neg_integer()
Gets the message type.
@spec new(non_neg_integer(), non_neg_integer(), binary(), binary()) :: t()
Creates a new SenderKeyMessage, signing with the Curve25519 private
signature_key.
Serializes the message to binary.
Verifies the XEd25519 signature against the Curve25519 public signature_key
(raw 32 bytes or 0x05-prefixed 33 bytes).