Versions in this module Expand all Collapse all v0 v0.8.1 Mar 5, 2024 v0.8.0 Oct 3, 2023 Changes in this version + const PrivateKeySize + const PublicKeySize + const SignatureSize + func InitCipher(secret SharedSecret) (cipher.Block, error) + type Encrypter struct + Private ecdh.PrivateKey + Public ecdh.PublicKey + func (b *Encrypter) Decrypt(other *Encrypter, ciphertext []byte) ([]byte, error) + func (b *Encrypter) Encrypt(other *Encrypter, plain []byte) ([]byte, error) + func (b *Encrypter) Generate() + func (b *Encrypter) GetSharedSecret(other *Encrypter) ([]byte, error) + type EncrypterMarshal MarshalledKey + type EncryptionPrivKeyType = *ecdh.PrivateKey + type EncryptionPubKeyType = *ecdh.PublicKey + type ISigner interface + Public func() []byte + Sign func([]byte) ([]byte, error) + Verify func([]byte) (bool, error) + type MarshalledKey struct + Private string + Public string + type SharedSecret []byte + func GetSharedSecret(me *Encrypter, other *Encrypter) (SharedSecret, error) + type Signature []byte + type Signer struct + Private SigningPrivKeyType + Public SigningPubKeyType + func (b *Signer) Encode() SignerMarshal + func (b *Signer) Generate() *Signer + func (b *Signer) MarshalPrivate() string + func (b *Signer) MarshalPublic() string + func (b *Signer) Sign(data []byte) (Signature, error) + func (b *Signer) UnmarshalPrivate(marshalled string) (SigningPrivKeyType, error) + func (b *Signer) UnmarshalPublic(marshalled string) (SigningPubKeyType, error) + func (b *Signer) Verify(data []byte, signature Signature) bool + type SignerMarshal MarshalledKey + func (b *SignerMarshal) Decode() (*Signer, error) + type SigningPrivKeyType = ed25519.PrivateKey + type SigningPubKeyType = ed25519.PublicKey + type SymmetricEncryption interface + Decrypt func(secret SharedSecret, data []byte) ([]byte, error) + Encrypt func(secret SharedSecret, date []byte) ([]byte, error)