zk: Move zk gadgets to separate gadget module.

This commit is contained in:
parazyd
2022-06-18 14:34:05 +02:00
parent c825aa527f
commit 12bb3a0cde
8 changed files with 16 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
use darkfi::zk::{
use darkfi::zk::gadget::{
arith_chip::{ArithChip, ArithConfig, ArithInstruction},
even_bits::{EvenBitsChip, EvenBitsConfig, EvenBitsLookup},
greater_than::{GreaterThanChip, GreaterThanConfig, GreaterThanInstruction},

View File

@@ -30,8 +30,8 @@ use crate::crypto::{
merkle_node::MerkleNode,
};
use crate::zk::{
arith_chip::{ArithChip, ArithConfig, ArithInstruction},
use crate::zk::gadget::{
arithmetic::{ArithChip, ArithConfig, ArithInstruction},
even_bits::{EvenBitsChip, EvenBitsConfig, EvenBitsLookup},
greater_than::{GreaterThanChip, GreaterThanConfig, GreaterThanInstruction},
};

8
src/zk/gadget/mod.rs Normal file
View File

@@ -0,0 +1,8 @@
/// Scalar arithmetic
pub mod arithmetic;
/// Even-bits lookup table
pub mod even_bits;
/// Greater than comparison gadget;
pub mod greater_than;

View File

@@ -1,14 +1,11 @@
/// Halo2 arithmetic chip
pub mod arith_chip;
/// Even bits lookup table
pub mod even_bits;
/// Greather than gadget
pub mod greater_than;
/// ZK gadget implementations
pub mod gadget;
/// Halo2 zkas virtual machine
pub mod vm;
pub mod vm_stack;
/// ZK circuits
pub mod circuit;
use halo2_proofs::{

View File

@@ -24,8 +24,8 @@ use halo2_proofs::{
use log::debug;
use pasta_curves::{group::Curve, pallas, Fp};
use super::{
arith_chip::{ArithChip, ArithConfig, ArithInstruction},
use super::gadget::{
arithmetic::{ArithChip, ArithConfig, ArithInstruction},
even_bits::{EvenBitsChip, EvenBitsConfig, EvenBitsLookup},
greater_than::{GreaterThanChip, GreaterThanConfig, GreaterThanInstruction},
};