PsaHashCompare

Calculate the hash (digest) of a message and compare it with a reference value. Opcode: 16 (0x0010)

Parameters

NameTypeDescription
algHashThe hash algorithm to compute
inputVector of unsigned bytesBuffer containing message to hash
hashVector of unsigned bytesBuffer containing expected hash value

Results

No values are returned by this operation.

If no error occurs, the computed hash matches the expected hash value.

Specific response status codes

  • PsaErrorInvalidSignature: The hash of the message was calculated successfully, but it differs from the expected hash.
  • PsaErrorNotSupported: alg is not supported.
  • PsaErrorInvalidArgument: The length of input or hash does not match the hash size for alg.

Description

Calculates the hash of the given message, using the specified algorithm, and compares the result with an expected hash value.

Contract

Protobuf

Copyright 2020 Contributors to the Parsec project.