package subtle
import "github.com/google/tink/go/mac/subtle"
Package subtle provides subtle implementations of the MAC primitive.
Index ¶
- func ValidateCMACParams(keySize, tagSize uint32) error
- func ValidateHMACParams(hash string, keySize uint32, tagSize uint32) error
- type AESCMAC
- func NewAESCMAC(key []byte, tagLength uint32) (*AESCMAC, error)
- func (a AESCMAC) ComputeMAC(data []byte) ([]byte, error)
- func (a AESCMAC) VerifyMAC(mac, data []byte) error
- type HMAC
Functions ¶
func ValidateCMACParams ¶
ValidateCMACParams validates the parameters for an AES-CMAC against the recommended parameters.
func ValidateHMACParams ¶
ValidateHMACParams validates parameters of HMAC constructor.
Types ¶
type AESCMAC ¶
type AESCMAC struct {
// contains filtered or unexported fields
}
AESCMAC represents an AES-CMAC struct that implements the MAC interface.
func NewAESCMAC ¶
NewAESCMAC creates a new AESCMAC object that implements the MAC interface.
func (AESCMAC) ComputeMAC ¶
ComputeMAC computes message authentication code (MAC) for code data.
func (AESCMAC) VerifyMAC ¶
VerifyMAC returns nil if mac is a correct authentication code (MAC) for data, otherwise it returns an error.
type HMAC ¶
HMAC implementation of interface tink.MAC
func NewHMAC ¶
NewHMAC creates a new instance of HMAC with the specified key and tag size.
func (*HMAC) ComputeMAC ¶
ComputeMAC computes message authentication code (MAC) for the given data.
func (*HMAC) VerifyMAC ¶
VerifyMAC verifies whether the given MAC is a correct message authentication code (MAC) the given data.
Source Files ¶
- Version
- v1.7.0 (latest)
- Published
- Aug 10, 2022
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 3 months ago –
Tools for package owners.