package subtle
import "github.com/google/tink/go/prf/subtle"
Package subtle provides an implementation of PRFs like AES-CMAC.
Index ¶
- func ValidateAESCMACPRFParams(keySize uint32) error
- func ValidateHKDFPRFParams(hash string, keySize uint32, salt []byte) error
- func ValidateHMACPRFParams(hash string, keySize uint32) error
- type AESCMACPRF
- func NewAESCMACPRF(key []byte) (*AESCMACPRF, error)
- func (a AESCMACPRF) ComputePRF(data []byte, outputLength uint32) ([]byte, error)
- type HKDFPRF
- func NewHKDFPRF(hashAlg string, key []byte, salt []byte) (*HKDFPRF, error)
- func (h HKDFPRF) ComputePRF(data []byte, outputLength uint32) ([]byte, error)
- type HMACPRF
Functions ¶
func ValidateAESCMACPRFParams ¶
ValidateAESCMACPRFParams checks that the key is the recommended size for AES-CMAC.
func ValidateHKDFPRFParams ¶
ValidateHKDFPRFParams validates parameters of HKDF constructor.
func ValidateHMACPRFParams ¶
ValidateHMACPRFParams validates parameters of HMAC constructor.
Types ¶
type AESCMACPRF ¶
type AESCMACPRF struct {
// contains filtered or unexported fields
}
AESCMACPRF is a type that can be used to compute several CMACs with the same key material.
func NewAESCMACPRF ¶
func NewAESCMACPRF(key []byte) (*AESCMACPRF, error)
NewAESCMACPRF creates a new AESCMACPRF object and initializes it with the correct key material.
func (AESCMACPRF) ComputePRF ¶
func (a AESCMACPRF) ComputePRF(data []byte, outputLength uint32) ([]byte, error)
ComputePRF computes the AES-CMAC for the given key and data, returning outputLength bytes. The timing of this function will only depend on len(data), and not leak any additional information about the key or the data.
type HKDFPRF ¶
type HKDFPRF struct {
// contains filtered or unexported fields
}
HKDFPRF is a type that can be used to compute several HKDFs with the same key material.
func NewHKDFPRF ¶
NewHKDFPRF creates a new HKDFPRF object and initializes it with the correct key material.
func (HKDFPRF) ComputePRF ¶
ComputePRF computes the HKDF for the given key and data, returning outputLength bytes.
type HMACPRF ¶
type HMACPRF struct {
// contains filtered or unexported fields
}
HMACPRF is a type that can be used to compute several HMACs with the same key material.
func NewHMACPRF ¶
NewHMACPRF creates a new HMACPRF object and initializes it with the correct key material.
func (HMACPRF) ComputePRF ¶
ComputePRF computes the HMAC for the given key and data, returning outputLength bytes.
Source Files ¶
aes_cmac.go hkdf.go hmac.go subtle.go
- Version
- v1.7.0 (latest)
- Published
- Aug 10, 2022
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 3 months ago –
Tools for package owners.