package ecdh
import "github.com/ProtonMail/go-crypto/openpgp/ecdh"
Package ecdh implements ECDH encryption, suitable for OpenPGP, as specified in RFC 6637, section 8.
Index ¶
- func Decrypt(priv *PrivateKey, vsG, c, curveOID, fingerprint []byte) (msg []byte, err error)
- func Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error)
- func Validate(priv *PrivateKey) error
- type KDF
- type PrivateKey
- func GenerateKey(rand io.Reader, c ecc.ECDHCurve, kdf KDF) (priv *PrivateKey, err error)
- func NewPrivateKey(key PublicKey) *PrivateKey
- func (sk *PrivateKey) MarshalByteSecret() []byte
- func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error
- type PublicKey
Functions ¶
func Decrypt ¶
func Decrypt(priv *PrivateKey, vsG, c, curveOID, fingerprint []byte) (msg []byte, err error)
func Encrypt ¶
func Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error)
func Validate ¶
func Validate(priv *PrivateKey) error
Types ¶
type KDF ¶
type PrivateKey ¶
func GenerateKey ¶
func NewPrivateKey ¶
func NewPrivateKey(key PublicKey) *PrivateKey
func (*PrivateKey) MarshalByteSecret ¶
func (sk *PrivateKey) MarshalByteSecret() []byte
func (*PrivateKey) UnmarshalByteSecret ¶
func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error
type PublicKey ¶
func NewPublicKey ¶
func NewPublicKey(curve ecc.ECDHCurve, kdfHash algorithm.Hash, kdfCipher algorithm.Cipher) *PublicKey
func (*PublicKey) GetCurve ¶
func (*PublicKey) MarshalPoint ¶
func (*PublicKey) UnmarshalPoint ¶
Source Files ¶
- Version
- v1.3.0 (latest)
- Published
- May 22, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 2 days ago –
Tools for package owners.