cryptoutil

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Curve25519KeySize = 32

Curve25519KeySize number of bytes in a Curve25519 public or private key.

View Source
const NonceSize = 24

NonceSize size of a nonce used by Box encryption (Xchacha20Poly1305).

Variables

This section is empty.

Functions

func DeriveECDHX25519 added in v0.1.7

func DeriveECDHX25519(fromPrivKey, toPubKey *[chacha.KeySize]byte) ([]byte, error)

DeriveECDHX25519 does X25519 ECDH using fromPrivKey and toPubKey.

func LengthPrefix added in v0.1.4

func LengthPrefix(array []byte) []byte

LengthPrefix array with a bigEndian uint32 value of array's length.

func Nonce

func Nonce(pub1, pub2 []byte) (*[NonceSize]byte, error)

Nonce makes a nonce using blake2b, to match the format expected by libsodium.

func PublicEd25519toCurve25519

func PublicEd25519toCurve25519(pub []byte) ([]byte, error)

PublicEd25519toCurve25519 takes an Ed25519 public key and provides the corresponding Curve25519 public key This function wraps PublicKeyToCurve25519 from Adam Langley's ed25519 repo: https://github.com/agl/ed25519 now moved to https://github.com/teserakt-io/golang-ed25519

func SecretEd25519toCurve25519

func SecretEd25519toCurve25519(priv []byte) ([]byte, error)

SecretEd25519toCurve25519 converts a secret key from Ed25519 to curve25519 format This function wraps PrivateKeyToCurve25519 from Adam Langley's ed25519 repo: https://github.com/agl/ed25519 now moved to https://github.com/teserakt-io/golang-ed25519

Types

This section is empty.

Jump to

Keyboard shortcuts

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