ratchet

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-2-Clause, BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const E2e = "e2e"
View Source
const Silent = "silent"

Variables

View Source
var NoPartnerErrorStr = "No relationship with partner found"

Functions

func New

func New(kv *versioned.KV, myID *id.ID, privKey *cyclic.Int,
	grp *cyclic.Group) error

New creates a new store for the passed user ID and private key. The store can then be accessed by calling LoadStore. Does not create at a unique prefix, if multiple Ratchets are needed, make sure to add an uint prefix to the KV before instantiation.

Types

type Ratchet

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

func Load

func Load(kv *versioned.KV, myID *id.ID, grp *cyclic.Group,
	cyHandler session.CypherHandler, services Services, rng *fastRNG.StreamGenerator) (
	*Ratchet, error)

Load loads an extant ratchet from disk

func (*Ratchet) AddPartner

func (r *Ratchet) AddPartner(partnerID *id.ID,
	partnerPubKey, myPrivKey *cyclic.Int, partnerSIDHPubKey *sidh.PublicKey,
	mySIDHPrivKey *sidh.PrivateKey, sendParams,
	receiveParams session.Params) (partner.Manager, error)

AddPartner adds a partner. Automatically creates both send and receive sessions using the passed cryptographic data and per the parameters sent

func (*Ratchet) AddService

func (r *Ratchet) AddService(tag string, processor message.Processor) error

func (*Ratchet) DeletePartner

func (r *Ratchet) DeletePartner(partnerID *id.ID) error

DeletePartner removes the associated contact from the E2E store

func (*Ratchet) GetAllPartnerIDs

func (r *Ratchet) GetAllPartnerIDs() []*id.ID

GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E relationship with.

func (*Ratchet) GetDHPrivateKey

func (r *Ratchet) GetDHPrivateKey() *cyclic.Int

GetDHPrivateKey returns the diffie hellman private key used to initially establish the ratchet.

func (*Ratchet) GetDHPublicKey

func (r *Ratchet) GetDHPublicKey() *cyclic.Int

GetDHPublicKey returns the diffie hellman public key used to initially establish the ratchet.

func (*Ratchet) GetPartner

func (r *Ratchet) GetPartner(partnerID *id.ID) (partner.Manager, error)

GetPartner returns the partner per its ID, if it exists

func (*Ratchet) RemoveService

func (r *Ratchet) RemoveService(tag string) error

type Services

type Services interface {
	AddService(
		clientID *id.ID, newService message.Service, response message.Processor)
	DeleteService(
		clientID *id.ID, toDelete message.Service, processor message.Processor)
}

Services is a subsection of the cmix.Manager interface used for services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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