Documentation ¶
Index ¶
- func ConstantTimeByteCompare(x, y []byte) (int, error)
- func ECDSAKey(curve elliptic.Curve, d []byte) *ecdsa.PrivateKey
- func ECDSAKeyFromPoint(curve elliptic.Curve, d *big.Int) *ecdsa.PrivateKey
- func ECDSAPublicKey(curve elliptic.Curve, x, y []byte) (*ecdsa.PublicKey, error)
- func HMACKeyDerivation(hash func() hash.Hash, bitLen int, key []byte, label, context []byte) ([]byte, error)
- func VerifySignature(key *ecdsa.PublicKey, hash []byte, signature []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstantTimeByteCompare ¶
ConstantTimeByteCompare is a constant-time byte comparison of x and y. This function performs an absolute comparison if the two byte slices assuming they represent a big-endian number.
error if len(x) != len(y) -1 if x < y 0 if x == y +1 if x > y
func ECDSAKey ¶
func ECDSAKey(curve elliptic.Curve, d []byte) *ecdsa.PrivateKey
ECDSAKey takes the given elliptic curve, and private key (d) byte slice and returns the private ECDSA key.
func ECDSAKeyFromPoint ¶
ECDSAKeyFromPoint takes the given elliptic curve and point and returns the private and public keypair
func ECDSAPublicKey ¶
ECDSAPublicKey takes the provide curve and (x, y) coordinates and returns *ecdsa.PublicKey. Returns an error if the given points are not on the curve.
func HMACKeyDerivation ¶
func HMACKeyDerivation(hash func() hash.Hash, bitLen int, key []byte, label, context []byte) ([]byte, error)
HMACKeyDerivation provides an implementation of a NIST-800-108 of a KDF (Key Derivation Function) in Counter Mode. For the purposes of this implantation HMAC is used as the PRF (Pseudorandom function), where the value of `r` is defined as a 4 byte counter.
Types ¶
This section is empty.