Documentation ¶
Index ¶
- func Decrypt(msg []byte, sk ed25519.PrivateKey) ([]byte, error)
- func DecryptECDH(msg []byte, sk ed25519.PrivateKey, pk ed25519.PublicKey) ([]byte, error)
- func Encrypt(msg []byte, pk ed25519.PublicKey) ([]byte, error)
- func EncryptECDH(msg []byte, sk ed25519.PrivateKey, pk ed25519.PublicKey) ([]byte, error)
- func KeyFromHex(h string) (ed25519.PublicKey, error)
- func KeyFromID(id pkg.Identifier) (ed25519.PublicKey, error)
- func PrivateKeyToCurve25519(sk ed25519.PrivateKey) [32]byte
- func PublicKeyToCurve25519(pk ed25519.PublicKey) [32]byte
- func Sign(privateKey ed25519.PrivateKey, message []byte) ([]byte, error)
- func Verify(publicKey ed25519.PublicKey, message, sig []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(msg []byte, sk ed25519.PrivateKey) ([]byte, error)
Decrypt decrypts msg with a cure25519 private key derived from an ed25519 private key
func DecryptECDH ¶ added in v0.4.9
DecryptECDH decrypt aes encrypted msg using a shared key derived from sk and pk using Elliptic curve Diffie Helman algorithm
func EncryptECDH ¶ added in v0.4.9
EncryptECDH aes encrypt msg using a shared key derived from sk and pk using Elliptic curve Diffie Helman algorithm the nonce if prepended to the encrypted message
func KeyFromHex ¶
KeyFromHex extract the public key from a hex string (used with jsx keys)
func KeyFromID ¶
func KeyFromID(id pkg.Identifier) (ed25519.PublicKey, error)
KeyFromID extract the public key from an Identifier
func PrivateKeyToCurve25519 ¶ added in v0.4.0
func PrivateKeyToCurve25519(sk ed25519.PrivateKey) [32]byte
PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding curve25519 private key such that the resulting curve25519 public key will equal the result from PublicKeyToCurve25519.
func PublicKeyToCurve25519 ¶ added in v0.4.0
PublicKeyToCurve25519 converts an Ed25519 public key into the curve25519 public
key that would be generated from the same private key.
Types ¶
This section is empty.