Documentation ¶
Overview ¶
Package ratchet implements the axolotl ratchet, by Trevor Perrin. See https://github.com/trevp/axolotl/wiki.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyExchange ¶
type KeyExchange struct { IdentityPublic []byte `bencode:"identity"` Dh []byte `bencode:"dh"` Dh1 []byte `bencode:"dh1"` }
func (KeyExchange) MarshalJSON ¶
func (k KeyExchange) MarshalJSON() ([]byte, error)
MarshalJSON makes the KeyExchange a json.Marshaler by hex-ing fields before putting them in the json
func (*KeyExchange) UnmarshalJSON ¶
func (k *KeyExchange) UnmarshalJSON(in []byte) error
UnmarshalJSON makes the *KeyExchange a json.Unmarshaler by un-hex-ing fields after taking them from the json
type Ratchet ¶
type Ratchet struct {
// contains filtered or unexported fields
}
Ratchet contains the per-contact, crypto state.
func (*Ratchet) CompleteKeyExchange ¶
func (r *Ratchet) CompleteKeyExchange(kx *KeyExchange) 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) GetKeyExchangeMaterial ¶
func (r *Ratchet) GetKeyExchangeMaterial() (kx *KeyExchange, err error)
GetKeyExchangeMaterial returns key exchange information from the ratchet.
Click to show internal directories.
Click to hide internal directories.