ratchet

package
v0.0.0-...-fb2b840 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ratchet provides the methods necessary to establish a ratchet session for group messaging.

Index

Constants

View Source
const KdfInfo string = "WhisperGroup"

KdfInfo is optional bytes to include in deriving secrets with KDF.

Variables

This section is empty.

Functions

This section is empty.

Types

type SenderChainKey

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

func NewSenderChainKey

func NewSenderChainKey(iteration uint32, chainKey []byte) *SenderChainKey

NewSenderChainKey will return a new SenderChainKey.

func NewSenderChainKeyFromStruct

func NewSenderChainKeyFromStruct(structure *SenderChainKeyStructure) *SenderChainKey

NewSenderChainKeyFromStruct will return a new chain key object from the given serializeable structure.

func (*SenderChainKey) Iteration

func (k *SenderChainKey) Iteration() uint32

func (*SenderChainKey) Next

func (k *SenderChainKey) Next() *SenderChainKey

func (*SenderChainKey) Seed

func (k *SenderChainKey) Seed() []byte

func (*SenderChainKey) SenderMessageKey

func (k *SenderChainKey) SenderMessageKey() (*SenderMessageKey, error)

type SenderChainKeyStructure

type SenderChainKeyStructure struct {
	Iteration uint32
	ChainKey  []byte
}

SenderChainKeyStructure is a serializeable structure of SenderChainKeys.

func NewStructFromSenderChainKey

func NewStructFromSenderChainKey(key *SenderChainKey) *SenderChainKeyStructure

NewStructFromSenderChainKeys returns a serializeable structure of chain keys.

type SenderMessageKey

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

SenderMessageKey is a structure for sender message keys used in group messaging.

func NewSenderMessageKey

func NewSenderMessageKey(iteration uint32, seed []byte) (*SenderMessageKey, error)

NewSenderMessageKey will return a new sender message key using the given iteration and seed.

func NewSenderMessageKeyFromStruct

func NewSenderMessageKeyFromStruct(structure *SenderMessageKeyStructure) *SenderMessageKey

NewSenderMessageKeyFromStruct will return a new message key object from the given serializeable structure.

func (*SenderMessageKey) CipherKey

func (k *SenderMessageKey) CipherKey() []byte

CipherKey will return the key in bytes.

func (*SenderMessageKey) Iteration

func (k *SenderMessageKey) Iteration() uint32

Iteration will return the sender message key's iteration.

func (*SenderMessageKey) Iv

func (k *SenderMessageKey) Iv() []byte

Iv will return the sender message key's initialization vector.

func (*SenderMessageKey) Seed

func (k *SenderMessageKey) Seed() []byte

Seed will return the sender message key's seed.

type SenderMessageKeyStructure

type SenderMessageKeyStructure struct {
	Iteration uint32
	IV        []byte
	CipherKey []byte
	Seed      []byte
}

SenderMessageKeyStructure is a serializeable structure of SenderMessageKeys.

func NewStructFromSenderMessageKey

func NewStructFromSenderMessageKey(key *SenderMessageKey) *SenderMessageKeyStructure

NewStructFromSenderMessageKey returns a serializeable structure of message keys.

Jump to

Keyboard shortcuts

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