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 dependencies halo2proof to v0.3.0 and halo2curve to v0.7.0 #87

Merged
merged 1 commit into from
Oct 25, 2024
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
90 changes: 50 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ cargo-llvm-cov = "0.6.13"
ethnum = "1.5.0"
hex = "0.4.3"
rbtree = "0.2.0"
halo2_proofs = { git = "https://github.com/orochi-network/halo2", tag = "v0_0_2" }
halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.2" }
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v0.3.0" }
halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "v0.7.0" }
ff = "0.13.0"
group = "0.13.0"
rand_core = "0.6.4"
rand = "0.8.5"
serde_json = "1.0.128"
serde = "1.0.210"
nova-snark = { git = "https://github.com/microsoft/Nova", default-features = false }
bellpepper-core = { version="0.4.0", default-features = false }
bellpepper-core = { version = "0.4.0", default-features = false }
arecibo = { git = "https://github.com/argumentcomputer/arecibo" }

15 changes: 5 additions & 10 deletions verkletree/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use group::Curve;
use halo2_proofs::{
arithmetic::lagrange_interpolate,
circuit::{Layouter, Region, SimpleFloorPlanner, Value},
halo2curves::{
bn256::{Bn256, Fr, G1Affine},
CurveAffineExt,
},
halo2curves::bn256::{Bn256, Fr, G1Affine},
plonk::{
create_proof, keygen_pk, keygen_vk, verify_proof, Advice, Circuit, Column,
ConstraintSystem, Error, Expression, Fixed, Instance, ProvingKey, Selector,
Expand Down Expand Up @@ -281,9 +278,8 @@ impl<S: Spec<Fr, W, R>, const W: usize, const R: usize, const A: usize>
)?;

// hash the commitment into a scalar value. We use Poseidon hash function
let (x, y) = commitment.into_coordinates();
let x_fr = Fr::from_bytes(&x.to_bytes()).unwrap();
let y_fr = Fr::from_bytes(&y.to_bytes()).unwrap();
let x_fr = Fr::from_bytes(&commitment.x.to_bytes()).unwrap();
let y_fr = Fr::from_bytes(&commitment.y.to_bytes()).unwrap();
let next_value = Hash::<Fr, S, ConstantLength<2>, W, R>::init().hash([x_fr, y_fr]);

// assign the current path node
Expand Down Expand Up @@ -458,11 +454,10 @@ impl KZGStruct {
&self,
commitment: G1Affine,
) -> Fr {
let (x_coordinate, y_coordinate) = commitment.into_coordinates();
let x_coordinate_fr =
Fr::from_bytes(&x_coordinate.to_bytes()).expect("Cannot convert x into Fr");
Fr::from_bytes(&commitment.x.to_bytes()).expect("Cannot convert x into Fr");
let y_coordinate_fr =
Fr::from_bytes(&y_coordinate.to_bytes()).expect("Cannot convert y into Fr");
Fr::from_bytes(&commitment.y.to_bytes()).expect("Cannot convert y into Fr");
Hash::<Fr, S, ConstantLength<2>, W, R>::init().hash([x_coordinate_fr, y_coordinate_fr])
}
}
Expand Down
13 changes: 5 additions & 8 deletions zkmemory/src/commitment/verkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use ff::Field;
use halo2_proofs::{
circuit::{Layouter, Region, SimpleFloorPlanner, Value},
halo2curves::bn256::{Bn256, Fr, G1Affine},
halo2curves::CurveAffineExt,
plonk::{
Advice, Circuit, Column, ConstraintSystem, Error, Expression, Fixed, Instance, Selector,
},
Expand Down Expand Up @@ -275,9 +274,9 @@ impl<S: Spec<Fr, W, R>, const W: usize, const R: usize, const A: usize>
)?;

// hash the commitment into a scalar value. We use Poseidon hash function
let (x, y) = commitment.into_coordinates();
let x_fr = Fr::from_bytes(&x.to_bytes()).unwrap();
let y_fr = Fr::from_bytes(&y.to_bytes()).unwrap();

let x_fr = Fr::from_bytes(&commitment.x.to_bytes()).unwrap();
let y_fr = Fr::from_bytes(&commitment.y.to_bytes()).unwrap();
let next_value = Hash::<Fr, S, ConstantLength<2>, W, R>::init().hash([x_fr, y_fr]);

// assign the current path node
Expand Down Expand Up @@ -341,7 +340,6 @@ mod tests {
use halo2_proofs::{
arithmetic::lagrange_interpolate,
dev::MockProver,
halo2curves::CurveAffineExt,
poly::{
commitment::Blind, kzg::multiopen::ProverSHPLONK, Coeff, EvaluationDomain, Polynomial,
},
Expand Down Expand Up @@ -398,11 +396,10 @@ mod tests {
&self,
commitment: G1Affine,
) -> Fr {
let (x_coordinate, y_coordinate) = commitment.into_coordinates();
let x_coordinate_fr =
Fr::from_bytes(&x_coordinate.to_bytes()).expect("Cannot convert x into Fr");
Fr::from_bytes(&commitment.x.to_bytes()).expect("Cannot convert x into Fr");
let y_coordinate_fr =
Fr::from_bytes(&y_coordinate.to_bytes()).expect("Cannot convert y into Fr");
Fr::from_bytes(&commitment.y.to_bytes()).expect("Cannot convert y into Fr");
Hash::<Fr, S, ConstantLength<2>, W, R>::init().hash([x_coordinate_fr, y_coordinate_fr])
}
}
Expand Down
Loading