Skip to main content

Module griffin

Module griffin 

Source
Expand description

Implementation of the Griffin circuit-friendly hash function and its parameter generation, as well as out-of-circuit widgets and in-circuit gadgets for permutation, hashing, sponges, and transcripts.

According to the Griffin paper, it is very efficient in terms of the number of constraints, but later an attack on Griffin and similar hash functions was discovered. Therefore, it is recommended to avoid using Griffin in production.

The code is forked from the implementation in the Hash Functions for Zero-Knowledge Applications Zoo but uses arkworks instead of bellman as the underlying cryptographic library.

Modules§

sponge
Implementation of transcript traits for Griffin sponge.

Structs§

Griffin
Griffin implements the Griffin permutation and Griffin hash.
GriffinGadget
GriffinGadget implements the gadgets for Griffin permutation and Griffin hash.
GriffinParams
GriffinParams stores the full parameterisation of the Griffin permutation for a given prime field: state width t, S-box degree d, number of rounds, round constants, alpha/beta constants, and the MDS-like matrix.