Documentation ¶
Overview ¶
Package chain provides chain keys used in double ratchet sessions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is used for generating message keys. This key "ratchets" every time a message key is generated. Every time the chain key ratchets forward, its index increases by one.
func NewKeyFromStruct ¶
func NewKeyFromStruct(structure *KeyStructure, kdf kdf.HKDF) *Key
NewKeyFromStruct will return a chain key built from the given structure.
func (*Key) BaseMaterial ¶
BaseMaterial uses hmac to derive the base material used in the key derivation function for a new key.
func (*Key) MessageKeys ¶
MessageKeys returns message keys, which includes the cipherkey, mac, iv, and index.
type KeyStructure ¶
KeyStructure is a serializeable structure for chain keys.
func NewStructFromKey ¶
func NewStructFromKey(key *Key) *KeyStructure
NewStructFromKey will return a chain key structure for serialization.
Click to show internal directories.
Click to hide internal directories.