diff --git a/docs/docs/icicle/primitives/hash.md b/docs/docs/icicle/primitives/hash.md index 43dc1b2a7..ac7428234 100644 --- a/docs/docs/icicle/primitives/hash.md +++ b/docs/docs/icicle/primitives/hash.md @@ -46,6 +46,9 @@ Keccak can take input messages of any length and produce a fixed-size hash. It u Traditional hash functions, such as SHA-2, are difficult to represent within ZK circuits because they involve complex bitwise operations that don’t translate efficiently into arithmetic operations. Poseidon, however, is specifically designed to minimize the number of constraints required in these circuits, making it significantly more efficient for use in ZK-SNARKs and other cryptographic protocols that require hashing over field elements. +Currently the Poseidon implementation is the Optimized Poseidon (https://hackmd.io/@jake/poseidon-spec#Optimized-Poseidon). Optimized Poseidon significantly decreases the calculation time of the hash. + +The optional `domain_tag` pointer parameter enables domain separation, allowing isolation of hash outputs across different contexts or applications. ## Using Hash API @@ -94,7 +97,7 @@ eIcicleError hash(const std::byte* input, uint64_t size, const HashConfig& confi * @tparam PREIMAGE The type of the input data. * @tparam IMAGE The type of the output data. * @param input Pointer to the input data. - * @param size The number of elements of type `PREIMAGE` to hash. + * @param size The number of elements of type `PREIMAGE` to a single hasher. * @param config Configuration options for the hash operation. * @param output Pointer to the output data. * @return An error code of type eIcicleError indicating success or failure. @@ -131,6 +134,10 @@ auto output = std::make_unique(32 * config.batch); // Allocate outp eIcicleErr err = keccak256.hash(input.data(), input.size() / config.batch, config, output.get()); ``` +### 4. Posidon sponge function + +Currently the poseidon sponge function isn't implemented. + ### Supported Bindings - [Rust](../rust-bindings/hash) diff --git a/icicle/include/icicle/hash/poseidon.h b/icicle/include/icicle/hash/poseidon.h index d81ed6eb1..2f4b897cb 100644 --- a/icicle/include/icicle/hash/poseidon.h +++ b/icicle/include/icicle/hash/poseidon.h @@ -8,7 +8,7 @@ namespace icicle { * * This function generates a Poseidon hash with customizable parameters to suit various cryptographic * contexts and use cases. The width parameter (`t`) determines the number of elements in the state, - * influencing the security level and output structure of the hash. The optional `domain_tag` parameter + * influencing the security level and output structure of the hash. The optional `domain_tag` pointer parameter * enables domain separation, allowing isolation of hash outputs across different contexts or applications. * * @param S Represents the type of the field element used by the hash (e.g., a field element class).