package crypto
import "github.com/aws/aws-sdk-go-v2/service/s3/internal/v4a/internal/crypto"
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)
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.
func VerifySignature ¶
VerifySignature takes the provided public key, hash, and asn1 encoded signature and returns whether the given signature is valid.
Source Files ¶
- Version
- v1.21.0
- Published
- Dec 2, 2021
- Platform
- windows/amd64
- Imports
- 10 packages
- Last checked
- 9 hours ago –
Tools for package owners.