libsignalgo.mau.fi/libsignal/keys/root Index | Files

package root

import "go.mau.fi/libsignal/keys/root"

Package root provides root keys which are used to derive new chain and root keys in a ratcheting session.

Index

Constants

const DerivedSecretsSize = 64

DerivedSecretsSize is the size of the derived secrets for root keys.

const KdfInfo string = "WhisperRatchet"

KdfInfo is used as the info for message keys to derive secrets using a Key Derivation Function

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key is a structure for RootKeys, which are used to derive a new set of chain and root keys for every round trip of messages.

func NewKey

func NewKey(kdf kdf.HKDF, key []byte) *Key

NewKey returns a new RootKey given the key derivation function and bytes.

func (*Key) Bytes

func (k *Key) Bytes() []byte

Bytes returns the RootKey in bytes.

func (*Key) CreateChain

func (k *Key) CreateChain(theirRatchetKey ecc.ECPublicKeyable, ourRatchetKey *ecc.ECKeyPair) (*session.KeyPair, error)

CreateChain creates a new RootKey and ChainKey from the recipient's ratchet key and our private key.

Source Files

RootKey.go

Version
v0.1.2 (latest)
Published
Feb 12, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
1 week ago

Tools for package owners.