Skip to content

Commit

Permalink
Merge pull request #87 from orochi-network/misc/update_dependencies
Browse files Browse the repository at this point in the history
Update dependencies halo2proof to v0.3.0 and halo2curve to v0.7.0
  • Loading branch information
chiro-hiro authored Oct 25, 2024
2 parents a69d2ef + fd4c43e commit b5f79ea
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 62 deletions.
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

0 comments on commit b5f79ea

Please sign in to comment.