Documentation ¶
Overview ¶
Package message provides a structure for message keys, which are symmetric keys used for the encryption/decryption of Signal messages.
Index ¶
Constants ¶
const CipherKeyLength = 32
CipherKeyLength is the length of the actual cipher key used for messages.
const DerivedSecretsSize = 80
DerivedSecretsSize is the size of the derived secrets for message keys.
const IVLength = 16
IVLength is the length of the initialization vector in bytes.
const KdfSalt string = "WhisperMessageKeys"
KdfSalt is used as the Salt for message keys to derive secrets using a Key Derivation Function
const MacKeyLength = 32
MacKeyLength is the length of the message authentication code in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
Keys is a structure to hold all the keys for a single MessageKey, including the cipherKey, mac, iv, and index of the chain key. MessageKeys are used to encrypt individual messages.
func NewKeys ¶
NewKeys returns a new message keys structure with the given cipherKey, mac, iv, and index.
func NewKeysFromStruct ¶
func NewKeysFromStruct(structure *KeysStructure) *Keys
NewKeysFromStruct will return a new message keys object from the given serializeable structure.
func (*Keys) Index ¶
Index returns the number of times the chain key has been put through a key derivation function to generate this message key.
type KeysStructure ¶
KeysStructure is a serializeable structure of message keys.
func NewStructFromKeys ¶
func NewStructFromKeys(keys *Keys) *KeysStructure
NewStructFromKeys returns a serializeable structure of message keys.