Documentation ¶
Overview ¶
Package ratchet implements the axolotl ratchet, by Trevor Perrin. See https://github.com/trevp/axolotl/wiki.
Index ¶
- type KeyExchange
- type Ratchet
- func (r *Ratchet) CompleteKeyExchange(kx *KeyExchange, alice bool) error
- func (r *Ratchet) Decrypt(ciphertext []byte) ([]byte, error)
- func (r *Ratchet) Encrypt(out, msg []byte) []byte
- func (r *Ratchet) FillKeyExchange(kx *KeyExchange) error
- func (r *Ratchet) Marshal(now time.Time, lifetime time.Duration) *disk.RatchetState
- func (r *Ratchet) Unmarshal(s *disk.RatchetState) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyExchange ¶
type KeyExchange struct { Cipher [sntrup4591761.CiphertextSize]byte Public []byte }
type Ratchet ¶
type Ratchet struct { MyPrivateKey *[sntrup4591761.PrivateKeySize]byte MySigningPublic *[ed25519.PublicKeySize]byte TheirIdentityPublic *[sha256.Size]byte TheirSigningPublic *[ed25519.PublicKeySize]byte TheirPublicKey *[sntrup4591761.PublicKeySize]byte // Now is an optional function that will be used to get the current // time. If nil, time.Now is used. Now func() time.Time MyHalf *[32]byte TheirHalf *[32]byte // 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.
Click to show internal directories.
Click to hide internal directories.