PsaMacVerify
Calculate the MAC of a message and compare it to an expected value. Opcode: 23 (0x0017
)
Parameters
Name | Type | Description |
---|---|---|
key_name | String | Name of the key to use for the operation |
alg | Mac | Mac algorithm to compute |
input | Vector of bytes | Buffer containing the input message |
mac | Vector of bytes | Buffer containing the expected MAC value |
key_name
must allow the usage flagverify_message
.
Results
No values are returned by this operation. If Success
is returned the MAC is valid.
Specific response status codes
PsaErrorNotPermitted
: The key does not have theverify_message
flag, or it does not permit the requested algorithm.PsaErrorInvalidSignature
: The MAC of the message was calculated successfully, but it differs from the expected value.
Description
This function will calculate the message authentication code (MAC) of a message and compare it to an expected value.
Contract
Copyright 2020 Contributors to the Parsec project.