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

Chore: Move Ratio Proof #236

Merged
merged 6 commits into from
Sep 2, 2022
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [\#197](https://github.com/Manta-Network/manta-rs/pull/197) Add ECLAIR utilities for next circuit upgrade

### Changed
- [\#236](https://github.com/Manta-Network/manta-rs/pull/236) Moved `RatioProof` from `manta-trusted-setup` to `manta-crypto`
- [\#180](https://github.com/Manta-Network/manta-rs/pull/180) Start moving to new `arkworks` backend for `manta-crypto`
- [\#191](https://github.com/Manta-Network/manta-rs/pull/191) Move HTTP Utilities to `manta-util`

Expand Down
1 change: 1 addition & 0 deletions manta-crypto/src/arkworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ pub mod constraint;
pub mod ff;
pub mod pairing;
pub mod rand;
pub mod ratio;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Ratio Proofs

use manta_crypto::{
use crate::{
arkworks::{
ec::{AffineCurve, ProjectiveCurve},
ff::{PrimeField, UniformRand, Zero},
Expand Down
6 changes: 2 additions & 4 deletions manta-trusted-setup/src/groth16/kzg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@

//! KZG Trusted Setup for Groth16

use crate::{
ratio::{HashToGroup, RatioProof},
util::{power_pairs, scalar_mul, Deserializer, NonZero, Serializer},
};
use crate::util::{power_pairs, scalar_mul, Deserializer, NonZero, Serializer};
use alloc::{vec, vec::Vec};
use core::{iter, ops::Mul};
use manta_crypto::{
arkworks::{
ff::{One, UniformRand},
pairing::{Pairing, PairingEngineExt},
ratio::{HashToGroup, RatioProof},
serialize::{CanonicalDeserialize, CanonicalSerialize, Read, SerializationError, Write},
},
rand::{CryptoRng, RngCore, Sample},
Expand Down
2 changes: 1 addition & 1 deletion manta-trusted-setup/src/groth16/mpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

use crate::{
groth16::kzg::{self, Accumulator},
ratio::{HashToGroup, RatioProof},
util::{batch_into_projective, batch_mul_fixed_scalar, merge_pairs_affine},
};
use alloc::{vec, vec::Vec};
Expand All @@ -29,6 +28,7 @@ use manta_crypto::{
ec::{AffineCurve, PairingEngine, ProjectiveCurve},
ff::{Field, PrimeField, UniformRand, Zero},
pairing::{Pairing, PairingEngineExt},
ratio::{HashToGroup, RatioProof},
relations::r1cs::{ConstraintSynthesizer, ConstraintSystem, SynthesisError},
},
rand::{CryptoRng, RngCore},
Expand Down
2 changes: 1 addition & 1 deletion manta-trusted-setup/src/groth16/ppot/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

use crate::{
groth16::{kzg::G1, ppot::kzg::PerpetualPowersOfTauCeremony},
ratio::HashToGroup,
util::{hash_to_group, BlakeHasher, Serializer},
};
use ark_bn254::{Fq, Fq2, G1Affine, G2Affine};
Expand All @@ -27,6 +26,7 @@ use manta_crypto::{
arkworks::{
ec::{short_weierstrass_jacobian::GroupAffine, ProjectiveCurve, SWModelParameters},
ff::{BigInteger256, Fp256, FpParameters, Zero},
ratio::HashToGroup,
},
rand::{RngCore, Sample},
};
Expand Down
2 changes: 1 addition & 1 deletion manta-trusted-setup/src/groth16/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use crate::{
mpc::{self, contribute, initialize, verify_transform, verify_transform_all, Proof, State},
},
mpc::{ChallengeType, ProofType, StateType, Transcript},
ratio::test::assert_valid_ratio_proof,
util::{BlakeHasher, HasDistribution, KZGBlakeHasher},
};
use alloc::vec::Vec;
Expand All @@ -36,6 +35,7 @@ use manta_crypto::{
ff::{field_new, UniformRand},
pairing::{test::assert_valid_pairing_ratio, Pairing},
r1cs_std::eq::EqGadget,
ratio::test::assert_valid_ratio_proof,
serialize::CanonicalSerialize,
},
eclair::alloc::{
Expand Down
1 change: 0 additions & 1 deletion manta-trusted-setup/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ extern crate alloc;

pub mod groth16;
pub mod mpc;
pub mod ratio;
pub mod util;
3 changes: 2 additions & 1 deletion manta-trusted-setup/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Utilities

use crate::{groth16::kzg, ratio::HashToGroup};
use crate::groth16::kzg;
use alloc::{boxed::Box, vec::Vec};
use ark_std::{
error,
Expand All @@ -29,6 +29,7 @@ use manta_crypto::{
ec::{wnaf::WnafContext, AffineCurve, ProjectiveCurve},
ff::{BigInteger, PrimeField, UniformRand, Zero},
pairing::Pairing,
ratio::HashToGroup,
serialize::{CanonicalSerialize, Read, SerializationError, Write},
},
rand::{ChaCha20Rng, OsRng, Sample, SeedableRng},
Expand Down