Documentation ¶
Index ¶
Constants ¶
View Source
const ( PublicKeySize = 1218 PrivateKeySize = 1600 CiphertextSize = 1047 )
Variables ¶
This section is empty.
Functions ¶
func Encapsulate ¶
Encapsulate generates a random shared key and encrypts it with the given public key. The shared key and its corresponding ciphertext are returned. Randomness is obtained from s.
func GenerateKey ¶
func GenerateKey(s io.Reader) (*PublicKey, *PrivateKey, error)
GenerateKey returns a new public/private key pair with randomness from s.
Types ¶
type Ciphertext ¶
type Ciphertext = [CiphertextSize]byte
type PrivateKey ¶
type PrivateKey = [PrivateKeySize]byte
type PublicKey ¶
type PublicKey = [PublicKeySize]byte
type SharedKey ¶
type SharedKey = [SharedKeySize]byte
func Decapsulate ¶
func Decapsulate(cstr *Ciphertext, sk *PrivateKey) (*SharedKey, int)
Decapsulate uses a private key to decrypt a ciphertext, returning a shared key.
Click to show internal directories.
Click to hide internal directories.