keyderivation

package
v0.0.0-...-e73c711 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package keyderivation provides functions to derive keys for symmetric encryption.

Index

Constants

This section is empty.

Variables

View Source
var (
	Blake2b256 = unkeyed(blake2b.New256)
	Blake2b384 = unkeyed(blake2b.New384)
	Blake2b512 = unkeyed(blake2b.New512)
)

Unkeyed Blake2b Hashes for use in the hkdf constructor.

View Source
var Hash func() hash.Hash = Blake2b512

Hash is the hash function used in HKDF. If you want a different one assign it before calling HKDF or any function that uses it. I.e.:

keyderivation.Hash = sha512.New

Functions

func Elliptic

func Elliptic(private, peer *[32]byte, salt []byte, info string) (key []byte)

Elliptic perform anonymous Diffie-Hellman and then derives a 32 byte key from the resulting shared secret with HKDF. Salt and info may be nil but provide additional entropy for HKDF.

func HKDF

func HKDF(secret, salt []byte, info string) (key []byte)

HKDF wraps crypto/hkdf to generate a single 32 byte key with the Hash defined at package level.

func Public

func Public(sec *[32]byte) (pub *[32]byte)

Public returns the Curve25519 public key of a secret key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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