root

package
v0.0.0-...-3295f72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const DerivedSecretsSize = 64

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

View Source
const KdfInfo string = "WhisperRatchet"

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

Variables

This section is empty.

Functions

This section is empty.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL