Versions in this module Expand all Collapse all v3 v3.0.4 Oct 17, 2025 v3.0.2 Oct 17, 2025 Changes in this version + const GlobalSalt + var ErrWrongSize = errors.New("wrong size") + var ErrZeroKey = errors.New("zero key") + type Key [2]SubKey + var ZeroKey Key + func KeyFromBytes(b []byte) (Key, error) + func KeyFromString(s string) (Key, error) + func NewKey(randy io.Reader) Key + func (k *Key) UnmarshalJSON(data []byte) error + func (k *Key) Write(p []byte) (int, error) + func (k Key) Bytes() []byte + func (k Key) Equal(j Key) bool + func (k Key) MarshalJSON() ([]byte, error) + func (k Key) MustBeValid() + func (k Key) Read(p []byte) (int, error) + func (k Key) String() string + type KeyPair [2]Key + var ZeroKeyPair KeyPair + func NewKeyPair(randy io.Reader) KeyPair + func (kp *KeyPair) UnmarshalJSON(data []byte) error + func (kp *KeyPair) Write(p []byte) (int, error) + func (kp KeyPair) Bytes() []byte + func (kp KeyPair) Decrypt(msg, eph, nonce, aad []byte) (plaintext []byte, err error) + func (kp KeyPair) GenerateSharedSecret(randomness io.Reader, pubKey PublicKey) (sharedSecret []byte, ephemeralPubKey []byte, err error) + func (kp KeyPair) MarshalJSON() ([]byte, error) + func (kp KeyPair) MustBeValid() + func (kp KeyPair) PrivateKey() PrivateKey + func (kp KeyPair) PrivateSigningKey() Key + func (kp KeyPair) Public() crypto.PublicKey + func (kp KeyPair) PublicKey() PublicKey + func (kp KeyPair) Seal(sec []byte, plainText []byte, nonce []byte, aad []byte) ([]byte, error) + func (kp KeyPair) Sign(_ io.Reader, digest []byte, _ crypto.SignerOpts) ([]byte, error) + func (kp KeyPair) String() string + func (kp KeyPair) Verify(pubKey crypto.PublicKey, digest []byte, signature []byte) bool + type PrivateKey Key + func (k PrivateKey) Bytes() []byte + func (k PrivateKey) Encryption() SubKey + func (k PrivateKey) Signing() SubKey + func (p PrivateKey) Equal(k crypto.PublicKey) bool + type PublicKey Key + func (k *PublicKey) UnmarshalJSON(data []byte) error + func (k *PublicKey) Write(p []byte) (int, error) + func (k PublicKey) Bytes() []byte + func (k PublicKey) Encryption() SubKey + func (k PublicKey) MarshalJSON() ([]byte, error) + func (k PublicKey) Nickname() string + func (k PublicKey) Signing() SubKey + func (k PublicKey) String() string + func (p PublicKey) Equal(k crypto.PublicKey) bool + type SubKey [subKeySize]byte + func (s SubKey) Bytes() []byte + func (s SubKey) String() string