diff --git a/example/vm/src/arith_chip.rs b/example/halo2/src/arith_chip.rs similarity index 82% rename from example/vm/src/arith_chip.rs rename to example/halo2/src/arith_chip.rs index e5d7b327f..1efad842c 100644 --- a/example/vm/src/arith_chip.rs +++ b/example/halo2/src/arith_chip.rs @@ -1,46 +1,16 @@ use halo2::{ - circuit::{Layouter, Chip, SimpleFloorPlanner}, - dev::MockProver, - plonk::{ - Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector, - }, + circuit::{Chip, Layouter}, + plonk::{Advice, Column, ConstraintSystem, Error, Selector}, poly::Rotation, }; -use halo2_gadgets::{ - ecc::{ - chip::{EccChip, EccConfig}, - FixedPoint, FixedPoints, - }, - poseidon::{ - Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig, - StateWord, Word, - }, - primitives, - primitives::{ - poseidon::{ConstantLength, P128Pow5T3}, - sinsemilla::S_PERSONALIZATION, - }, - sinsemilla::{ - chip::{SinsemillaChip, SinsemillaConfig}, - merkle::chip::{MerkleChip, MerkleConfig}, - merkle::MerklePath, - }, - utilities::{ - lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var, - }, -}; -use pasta_curves::{ - arithmetic::{CurveAffine, Field}, - group::{ff::PrimeFieldBits, Curve}, - pallas, -}; -use std::time::Instant; +use halo2_gadgets::utilities::{CellValue, Var}; +use pasta_curves::pallas; type Variable = CellValue; // Replace with use pasta::Fp and pasta::Fq type Fp = pallas::Base; -type Fq = pallas::Scalar; +//type Fq = pallas::Scalar; #[derive(Clone, Debug)] pub struct ArithmeticChipConfig { @@ -53,7 +23,7 @@ pub struct ArithmeticChipConfig { } pub struct ArithmeticChip { - config: ArithmeticChipConfig + config: ArithmeticChipConfig, } impl Chip for ArithmeticChip { @@ -121,14 +91,19 @@ impl ArithmeticChip { }); */ - ArithmeticChipConfig { a_col, b_col, /*permute,*/ s_add, s_mul /*, s_pub*/ } + ArithmeticChipConfig { + a_col, + b_col, + /*permute,*/ s_add, + s_mul, /*, s_pub*/ + } } pub fn add( &self, mut layouter: impl Layouter, a: Variable, - b: Variable + b: Variable, ) -> Result { let mut out = None; layouter.assign_region( @@ -171,7 +146,7 @@ impl ArithmeticChip { &self, mut layouter: impl Layouter, a: Variable, - b: Variable + b: Variable, ) -> Result { let mut out = None; layouter.assign_region( @@ -231,4 +206,3 @@ impl ArithmeticChip { } */ } - diff --git a/example/halo2/src/lib.rs b/example/halo2/src/lib.rs index f43a6ca01..8f68e90b4 100644 --- a/example/halo2/src/lib.rs +++ b/example/halo2/src/lib.rs @@ -1,3 +1,4 @@ +pub mod arith_chip; pub mod constants; pub mod crypto; pub mod endian; @@ -5,3 +6,5 @@ pub mod error; pub mod proof; pub mod serial; pub mod spec; +//pub mod vm2; +//pub mod vm2_serial; diff --git a/example/vm/src/vm2.rs b/example/halo2/src/vm2.rs similarity index 100% rename from example/vm/src/vm2.rs rename to example/halo2/src/vm2.rs diff --git a/example/vm/src/vm2_serial.rs b/example/halo2/src/vm2_serial.rs similarity index 100% rename from example/vm/src/vm2_serial.rs rename to example/halo2/src/vm2_serial.rs