Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknownCSID = errors.New("cipherset: unknown CSID") ErrInvalidKey = errors.New("cipherset: invalid key") ErrInvalidState = errors.New("cipherset: invalid state") ErrInvalidMessage = errors.New("cipherset: invalid message") ErrInvalidPacket = errors.New("cipherset: invalid packet") )
View Source
var ErrInvalidKeys = errors.New("chipherset: invalid keys")
View Source
var ErrInvalidParts = errors.New("chipherset: invalid parts")
Functions ¶
func DecryptMessage ¶
func SelectCSID ¶
Types ¶
type Handshake ¶
type Key ¶
type Key interface { CSID() uint8 String() string Public() []byte Private() []byte CanSign() bool CanEncrypt() bool }
func GenerateKey ¶
type Keys ¶
func GenerateKeys ¶
func KeysFromJSON ¶
func (Keys) ApplyToHeader ¶
func (Keys) MarshalJSON ¶
func (*Keys) UnmarshalJSON ¶
type PrivateKeys ¶
type PrivateKeys Keys
func (PrivateKeys) MarshalJSON ¶
func (p PrivateKeys) MarshalJSON() ([]byte, error)
func (*PrivateKeys) UnmarshalJSON ¶
func (p *PrivateKeys) UnmarshalJSON(data []byte) error
type State ¶
type State interface { CSID() uint8 LocalToken() Token RemoteToken() Token SetRemoteKey(k Key) error NeedsRemoteKey() bool CanEncryptMessage() bool CanEncryptHandshake() bool CanEncryptPacket() bool CanDecryptMessage() bool CanDecryptHandshake() bool CanDecryptPacket() bool IsHigh() bool EncryptMessage(in []byte) ([]byte, error) EncryptHandshake(at uint32, compact Parts) ([]byte, error) ApplyHandshake(Handshake) bool EncryptPacket(pkt *lob.Packet) (*lob.Packet, error) DecryptPacket(pkt *lob.Packet) (*lob.Packet, error) }
Directories ¶
Path | Synopsis |
---|---|
Package cs1a implements Cipher Set 1a.
|
Package cs1a implements Cipher Set 1a. |
eccp
Elliptic Curve Compressed Point marshaler
|
Elliptic Curve Compressed Point marshaler |
ecdh
Elliptic curve Diffie–Hellman key sharing
|
Elliptic curve Diffie–Hellman key sharing |
secp160r1
Parameters for the secp160r1 Elliptic curve
|
Parameters for the secp160r1 Elliptic curve |
Package cs3a implements Cipher Set 3a.
|
Package cs3a implements Cipher Set 3a. |
Click to show internal directories.
Click to hide internal directories.