This PR exposes the low-level API of the SHA-256 hash function in o1js.
It supports the development of partialSHA and dynamicSHA as external packages while leveraging the efficiencies of the low-level API.
Closes #1668.
Changes
Separated the low-level SHA-256 functions and exported them as part of the SHA-256 gadgets in o1js.
Added 2 importable functions and 1 constant:
SHA-256 Compression Function
Enables flexible block hashing with better control of initial and intermediate hashes.
Message Schedule Computation Function
Computes the message schedule from message blocks to prepare it as input to the compression function.
SHA256 Initial State Constant
The initial hash values, also known as the SHA256 nothing-up-my-sleeve constants, are now exposed for enhanced flexibility in constructing SHA256 hashes.
Description
partialSHA
anddynamicSHA
as external packages while leveraging the efficiencies of the low-level API.Changes
initial
andintermediate
hashes.message blocks
to prepare it as input to the compression function.