Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update zeth submodule [mimc-selector] #100

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dev-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Build grpc
run: |
pushd depends/zeth
if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi
if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.32.x ; fi
popd

build-documentation:
Expand All @@ -39,7 +39,7 @@ jobs:
run: |
sudo apt update -y
pushd depends/zeth
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
INSTALL_ONLY=1 scripts/install-grpc /usr v1.32.x
popd
sudo apt install -y doxygen graphviz
- name: Generate documentation
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/onpullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build grpc
run: |
pushd depends/zeth
if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.31.x ; fi
if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.32.x ; fi
popd

build-linux-full-tests:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Install dependencies
run: |
pushd depends/zeth
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
INSTALL_ONLY=1 scripts/install-grpc /usr v1.32.x
popd
- name: Execute
run: CI_FULL_TESTS=1 CI_CONFIG=Release scripts/ci build
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Install dependencies
run: |
pushd depends/zeth
INSTALL_ONLY=1 scripts/install-grpc /usr v1.31.x
INSTALL_ONLY=1 scripts/install-grpc /usr v1.32.x
popd
- name: Execute
run: CI_INTEGRATION_TESTS=1 CI_CONFIG=Release scripts/ci build
57 changes: 0 additions & 57 deletions libzecale/circuits/compression_function_selector.hpp

This file was deleted.

5 changes: 2 additions & 3 deletions libzecale/circuits/verification_key_hash_gadget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
#ifndef __ZECALE_CIRCUITS_VERIFICATION_KEY_HASH_GADGET_HPP__
#define __ZECALE_CIRCUITS_VERIFICATION_KEY_HASH_GADGET_HPP__

#include "libzecale/circuits/compression_function_selector.hpp"

#include <libsnark/gadgetlib1/gadgets/basic_gadgets.hpp>
#include <libsnark/gadgetlib1/gadgets/hashes/hash_io.hpp>
#include <libzeth/circuits/mimc/mimc_input_hasher.hpp>
#include <libzeth/circuits/mimc/mimc_selector.hpp>

namespace libzecale
{
Expand All @@ -22,7 +21,7 @@ class verification_key_hash_gadget : public libsnark::gadget<libff::Fr<wppT>>
{
public:
using FieldT = libff::Fr<wppT>;
using compFnT = compression_function_gadget<wppT>;
using compFnT = libzeth::mimc_compression_function_gadget<FieldT>;
using scalarHasherT = libzeth::mimc_input_hasher<FieldT, compFnT>;

using nsnark = typename nverifierT::snark;
Expand Down
32 changes: 16 additions & 16 deletions libzecale/tests/aggregator/aggregator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,29 @@ using namespace libzeth;
namespace libzeth
{

// Use mimc7 by default
template<> class tree_hash_selector<libff::mnt4_Fr>
{
public:
using tree_hash = MiMC_mp_gadget<
libff::mnt4_Fr,
MiMC_permutation_gadget<libff::mnt4_Fr, 7, 91>>;
};
template<> class tree_hash_selector<libff::mnt6_Fr>
{
public:
using tree_hash = MiMC_mp_gadget<
libff::mnt6_Fr,
MiMC_permutation_gadget<libff::mnt6_Fr, 7, 91>>;
};
// // Use mimc7 by default
// template<> class tree_hash_selector<libff::mnt4_Fr>
// {
// public:
// using tree_hash = MiMC_mp_gadget<
// libff::mnt4_Fr,
// MiMC_permutation_gadget<libff::mnt4_Fr, 7, 91>>;
// };
// template<> class tree_hash_selector<libff::mnt6_Fr>
// {
// public:
// using tree_hash = MiMC_mp_gadget<
// libff::mnt6_Fr,
// MiMC_permutation_gadget<libff::mnt6_Fr, 7, 91>>;
// };

} // namespace libzeth

// The templates and constants used in the Zeth circuit.
template<typename nppT> using hash = libzeth::BLAKE2s_256<libff::Fr<nppT>>;
template<typename nppT>
using hashTree =
typename libzeth::tree_hash_selector<libff::Fr<nppT>>::tree_hash;
typename libzeth::mimc_compression_function_gadget<libff::Fr<nppT>>;

static const size_t tree_depth = 4;
static const size_t inputs_number = 2;
Expand Down