Documentation ¶
Overview ¶
Package ratchet implements the axolotl ratchet, by Trevor Perrin. See https://github.com/trevp/axolotl/wiki.
Index ¶
- Variables
- func EncryptedSize(msgSize int) int
- type KeyExchange
- type RVPoint
- type Ratchet
- func (r *Ratchet) CompleteKeyExchange(kx *KeyExchange, alice bool) error
- func (r *Ratchet) Decrypt(ciphertext []byte) ([]byte, error)
- func (r *Ratchet) DiskState(lifetime time.Duration) *disk.RatchetState
- func (r *Ratchet) Encrypt(out, msg []byte) ([]byte, error)
- func (r *Ratchet) FillKeyExchange(kx *KeyExchange) error
- func (r *Ratchet) LastEncDecTimes() (time.Time, time.Time)
- func (r *Ratchet) NbSavedKeys() int
- func (r *Ratchet) RecvRendezvous() (RVPoint, RVPoint)
- func (r *Ratchet) RecvRendezvousPlainText() (string, string)
- func (r *Ratchet) SendRendezvous() RVPoint
- func (r *Ratchet) SendRendezvousPlainText() string
- func (r *Ratchet) Unmarshal(s *disk.RatchetState) error
- func (r *Ratchet) WillRatchet() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnmarshal = errors.New("failed to unmarshal")
Functions ¶
func EncryptedSize ¶
EncryptedSize returns the estimated size for an encrypted ratched message, given the specified payload msg size.
Types ¶
type KeyExchange ¶
type KeyExchange struct { Public []byte `json:"public"` Cipher zkidentity.FixedSizeSntrupCiphertext `json:"cipher"` }
type RVPoint ¶
type RVPoint = zkidentity.ShortID
type Ratchet ¶
type Ratchet struct { MyPrivateKey *zkidentity.FixedSizeSntrupPrivateKey TheirPublicKey *zkidentity.FixedSizeSntrupPublicKey // contains filtered or unexported fields }
Ratchet contains the per-contact, crypto state.
func (*Ratchet) CompleteKeyExchange ¶
func (r *Ratchet) CompleteKeyExchange(kx *KeyExchange, alice bool) error
CompleteKeyExchange takes a KeyExchange message from the other party and establishes the ratchet.
func (*Ratchet) Encrypt ¶
Encrypt acts like append() but appends an encrypted version of msg to out.
func (*Ratchet) FillKeyExchange ¶
func (r *Ratchet) FillKeyExchange(kx *KeyExchange) error
FillKeyExchange sets elements of kx with key exchange information from the ratchet.
func (*Ratchet) LastEncDecTimes ¶ added in v0.1.4
func (*Ratchet) NbSavedKeys ¶ added in v0.1.4
NbSavedKeys returns the total number of saved keys.
func (*Ratchet) RecvRendezvous ¶
func (*Ratchet) RecvRendezvousPlainText ¶
func (*Ratchet) SendRendezvous ¶
func (*Ratchet) SendRendezvousPlainText ¶
func (*Ratchet) WillRatchet ¶ added in v0.1.4
WillRatchet returns whether the next message sent will cause a ratchet op.
Click to show internal directories.
Click to hide internal directories.