Discover Packages
github.com/Luca3317/ligsignalCOPY
kdf
package
Version:
v0.0.0-...-331fbfb
Opens a new window with list of versions in this module.
Published: May 10, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package kdf provides a key derivation function to calculate key output
and negotiate shared secrets for curve X25519 keys.
func CalculateSharedSecret(theirKey, ourKey [32]byte ) [32]byte
CalculateSharedSecret uses DH Curve25519 to find a shared secret. The result of this function
should be used in `DeriveSecrets` to output the Root and Chain keys.
func DeriveSecrets(inputKeyMaterial, salt, info []byte , outputLength int ) ([]byte , error )
DeriveSecrets derives the requested number of bytes using HKDF with the given
input, salt, and info.
type HKDF func(inputKeyMaterial, salt, info []byte , outputLength int ) ([]byte , error )
HKDF is a hashed key derivation function type that can be used to derive keys.
type KeyMaterial struct {
CipherKey []byte
MacKey []byte
IV []byte
}
KeyMaterial is a structure for representing a cipherkey, mac, and iv
Source Files
¶
Click to show internal directories.
Click to hide internal directories.