Device Functions#
In the following function descriptions, HASH is used as a placeholder for the cuPQC-Hash descriptor object that is instantiated with a specific hash algorithm.
reset#
update#
- __device__ void HASH::update(
- const uint8_t *message,
- const size_t message_length
Append a message into the hash state. This may be called multiple times to incrementally update a single message. This is for non-Poseidon2 hash functions.
- Parameters:
message – Buffer containing the message.
message_length – Length of the
messagebuffer.
- __device__ void HASH::update(
- const uint32_t *message,
- const size_t message_length
Append a message into the hash state. This may be called multiple times to incrementally update a single message. This is only available for Poseidon2 hash functions.
- Parameters:
message – Buffer containing the message.
message_length – Length of the
messagebuffer.
finalize#
digest#
- __device__ void HASH::digest(
- uint8_t *digest,
- const size_t digest_length
Extract the hash state into a digest. This may be called multiple times to incrementally digest a single message.
- Parameters:
digest – Buffer to which the digest will be written. Must be of length
digest_length, and 8-byte aligned.digest_length – Length of the
digestbuffer.
- __device__ void HASH::digest(
- uint32_t *digest,
- const size_t digest_length
Extract the hash state into a digest. This may be called multiple times to incrementally digest a single message. This is only available for Poseidon2 hash functions.
- Parameters:
digest – Buffer to which the digest will be written. Must be of length
digest_length, and 8-byte aligned.digest_length – Length of the
digestbuffer.