Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
mimc_selector.hpp
Go to the documentation of this file.
1 // Copyright (c) 2015-2022 Clearmatics Technologies Ltd
2 //
3 // SPDX-License-Identifier: LGPL-3.0+
4 
5 #ifndef __ZETH_CIRCUITS_MIMC_MIMC_SELECTOR_HPP__
6 #define __ZETH_CIRCUITS_MIMC_MIMC_SELECTOR_HPP__
7 
9 
10 #include <libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp>
11 #include <libff/algebra/curves/bls12_377/bls12_377_pp.hpp>
12 #include <libff/algebra/curves/bw6_761/bw6_761_pp.hpp>
13 #include <libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp>
14 #include <libff/algebra/curves/mnt/mnt6/mnt6_pp.hpp>
15 
16 namespace libzeth
17 {
18 
23 template<typename FieldT> class mimc_compression_function_selector;
24 
25 // For alt-bn128, use MiMC17 with 65 rounds.
26 template<> class mimc_compression_function_selector<libff::alt_bn128_Fr>
27 {
28 public:
30  libff::alt_bn128_Fr,
32 };
33 
34 // For bls12-377, use MiMC17 with 62 rounds.
35 template<> class mimc_compression_function_selector<libff::bls12_377_Fr>
36 {
37 public:
39  libff::bls12_377_Fr,
41 };
42 
43 // For bw6-761, use MiMC17 with 93 rounds.
44 template<> class mimc_compression_function_selector<libff::bw6_761_Fr>
45 {
46 public:
48  libff::bw6_761_Fr,
50 };
51 
52 // For MNT4, use MiMC17 with 73 rounds.
53 template<> class mimc_compression_function_selector<libff::mnt4_Fr>
54 {
55 public:
57  libff::mnt4_Fr,
59 };
60 
61 // For MNT6, use MiMC17 with 73 rounds.
62 template<> class mimc_compression_function_selector<libff::mnt6_Fr>
63 {
64 public:
66  libff::mnt6_Fr,
68 };
69 
70 template<typename FieldT>
73  FieldT>::compression_function_gadget;
74 
75 } // namespace libzeth
76 
77 #endif // __ZETH_CIRCUITS_MIMC_MIMC_SELECTOR_HPP__
libzeth
Definition: binary_operation.hpp:15
libzeth::MiMC_permutation_gadget
Definition: mimc_permutation.hpp:20
libzeth::mimc_compression_function_selector
Definition: mimc_selector.hpp:23
mimc_mp.hpp
libzeth::MiMC_mp_gadget
Definition: mimc_mp.hpp:30
libzeth::mimc_compression_function_gadget
typename mimc_compression_function_selector< FieldT >::compression_function_gadget mimc_compression_function_gadget
Definition: mimc_selector.hpp:73