template<typename FieldT, typename PermutationT>
class libzeth::MiMC_mp_gadget< FieldT, PermutationT >
This gadget implements the interface of the HashTreeT template.
MiMC_mp_gadget enforces correct computation of the MiMC compression function, based on a the Miyaguchi-Preneel compression construct using a MiMC_permutation_gadget instance, PermutationT, operating on FieldT elements.
This class contains only an instance of PermutationT, with parameters configured to make it efficiently compute Miyaguchi-Preneel. As such, it may appear as first sight that it should inherit from PermutationT. We do not inherit from PermutationT, either publicly (because the "is-a" relationship does not hold in general), or privately (because the pb_linear_combination interface does not support immediate construction of x + y
, making the constructor very awkard - this is also the reason that a pointer is required, rather than a simple instance of PermutationT). Further, we do not inherit from libsnark::gadget<>, as it is not necessary and would just add unused data to the class.
Definition at line 30 of file mimc_mp.hpp.