crypto

package
v0.0.0-...-3aeaace Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(secretKey []byte, additional []byte, ciphertext []byte) ([]byte, error)

Decrypt combines secretKey and secondKey to decrypt AES256-GCM.

func DeriveSharedKey

func DeriveSharedKey(priv *btcec.PrivateKey, pub *btcec.PublicKey, kdf func([]byte) []byte) []byte

DeriveSharedKey derives a shared key (which can be used for asymmetric encryption) using a specified KDF (Key Derivation Function) from a shared secret generated by Diffie-Hellman key exchange (ECDH).

func Encrypt

func Encrypt(secretKey, additional, data []byte) ([]byte, error)

Encrypt combines secretKey and secondKey to encrypt with AES256-GCM method.

func KDFSHA256

func KDFSHA256(in []byte) []byte

KDFSHA256 is a key derivation function which uses SHA256.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL