Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CryptoSwitch ¶
type CryptoSwitch struct {
// contains filtered or unexported fields
}
func NewCryptoSwitch ¶
func NewCryptoSwitch(cipher Cipher, mode Mode) *CryptoSwitch
func (*CryptoSwitch) Decrypt ¶
func (cw *CryptoSwitch) Decrypt(privkey *PrivateKey, msg []byte) ([]byte, error)
Decrypt decrypts a passed message with a receiver private key, returns plaintext or decryption error
type PrivateKey ¶
func (*PrivateKey) Encapsulate ¶
func (k *PrivateKey) Encapsulate(pub *PublicKey) ([]byte, []byte, error)
Encapsulate encapsulates key by using Key Encapsulation Mechanism and returns symmetric key; can be safely used as encryption key
type PublicKey ¶
PublicKey instance with nested elliptic.Curve interface (secp256k1 instance in our case)
func (*PublicKey) Bytes ¶
Bytes returns public key raw bytes; Could be optionally compressed by dropping Y part
func (*PublicKey) Decapsulate ¶
func (k *PublicKey) Decapsulate(priv *PrivateKey) ([]byte, []byte, error)
Decapsulate decapsulates key by using Key Encapsulation Mechanism and returns symmetric key; can be safely used as encryption key
Click to show internal directories.
Click to hide internal directories.