Documentation
¶
Index ¶
- type Cipher
- type CryptoSwitch
- func (cw *CryptoSwitch) Decapsulate(alicePubKey *PublicKey, bobPrivKy *PrivateKey) ([]byte, []byte, error)
- func (cw *CryptoSwitch) Decrypt(bobPrivKey *PrivateKey, msgPtr *[]byte) (*[]byte, error)
- func (cw *CryptoSwitch) Encapsulate(alicePriveKey *PrivateKey, bobPubKey *PublicKey) ([]byte, []byte, error)
- func (cw *CryptoSwitch) Encrypt(bobPubKey *PublicKey, msg *[]byte) (*[]byte, error)
- type Mode
- type PrivateKey
- type PublicKey
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) Decapsulate ¶
func (cw *CryptoSwitch) Decapsulate(alicePubKey *PublicKey, bobPrivKy *PrivateKey) ([]byte, []byte, error)
Decapsulate decapsulates key by using Key Encapsulation Mechanism and returns k_enc, k_mac
func (*CryptoSwitch) Decrypt ¶
func (cw *CryptoSwitch) Decrypt(bobPrivKey *PrivateKey, msgPtr *[]byte) (*[]byte, error)
Decrypt decrypts a passed message with a receiver private key, returns plaintext or decryption error
func (*CryptoSwitch) Encapsulate ¶
func (cw *CryptoSwitch) Encapsulate(alicePriveKey *PrivateKey, bobPubKey *PublicKey) ([]byte, []byte, error)
Decapsulate decapsulates key by using Key Encapsulation Mechanism and returns k_enc, k_mac can be safely used as encryption key
type PrivateKey ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.