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

Develop #42

Closed
wants to merge 60 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3a71974
feat: add assign_regions api
kunxian-xia Feb 7, 2023
d2b83b3
fix lifetime compilation error
kunxian-xia Feb 8, 2023
ce99b2d
include assign_regions in plonk_api test
kunxian-xia Feb 8, 2023
7af66a8
fmt
kunxian-xia Feb 8, 2023
032cd5d
feat: implement fork for MockProver (WIP)
kunxian-xia Feb 8, 2023
04b3509
add MockProver fork (continue)
kunxian-xia Feb 9, 2023
7e8cfe4
fmt
kunxian-xia Feb 9, 2023
87aaef3
finished adding fork for MockProver
kunxian-xia Feb 9, 2023
49a136f
log
kunxian-xia Feb 10, 2023
73c70ed
add impl for keygen
kunxian-xia Feb 10, 2023
28116e1
add impl for prover
kunxian-xia Feb 10, 2023
eeed482
bug_fix: update fixed in MockProver
kunxian-xia Feb 13, 2023
fa5b1b0
bug-fix: merge
kunxian-xia Feb 13, 2023
843feaa
add parallel_syn feature and refactor code using macro
kunxian-xia Mar 9, 2023
b09c358
fix
kunxian-xia Mar 10, 2023
460e708
fmt
kunxian-xia Mar 10, 2023
f5f5e29
clippy
kunxian-xia Mar 10, 2023
4e36256
clippy
kunxian-xia Mar 10, 2023
ed4985f
fix unit test error
kunxian-xia Mar 10, 2023
13a4381
clippy
kunxian-xia Mar 10, 2023
ea67b33
clippy
kunxian-xia Mar 10, 2023
088a066
Merge remote-tracking branch 'origin/scroll-dev-0220' into parallel_syn
kunxian-xia Mar 10, 2023
1c21e5b
Merge pull request #32 from scroll-tech/parallel_syn
kunxian-xia Mar 22, 2023
2e9710c
[chore] update cargo.toml
zhenfeizhang Mar 23, 2023
e67fc53
Merge branch 'v0.3' into halo2-ecc-snark-verifier-0323
lispc Apr 9, 2023
3d40ae4
update cargo lock
lispc Apr 9, 2023
1c78e16
add default implementation for fork and merge functions (#39)
kunxian-xia Apr 3, 2023
9bf3562
export advices for MockProver
lispc Apr 27, 2023
aab39d5
fix load_slice panic in mock prover err display
lispc Jul 4, 2023
90e22c6
boundary handling of the fork() function in MockProver
Velaciela Jul 5, 2023
ea07115
keygen, prover, and error message
Velaciela Jul 5, 2023
b2f596a
lints
Velaciela Jul 5, 2023
103ce21
Merge pull request #50 from scroll-tech/mockprover_fork
kunxian-xia Jul 6, 2023
a00de9e
disable selector compression (#54)
lispc Jul 11, 2023
fcf53dc
Fix clippy warnings and comment out outdated integration test cases (…
kunxian-xia Jul 18, 2023
7012b49
change ConstraintSystem::general_column_annotations from hashmap to b…
lispc Jul 21, 2023
4d8a405
derive Eq for cs
lispc Jul 21, 2023
01f0b52
MockProver can report phase error better
lispc Aug 7, 2023
b612b1e
Fix: false alarm in phase check of mock prover (#61)
kunxian-xia Aug 17, 2023
19de67c
Perf: batch invert on CellValue for MockProver (#62)
Velaciela Aug 18, 2023
aa86c10
feature flag: mock-batch-inv (#63)
Velaciela Aug 30, 2023
ca3066c
expose param field for re-randomization (#67)
zhenfeizhang Sep 19, 2023
e3fe25e
change log level
lispc Sep 20, 2023
92fe9b3
Use thread pool for assign_regions (#57)
alannotnerd Oct 17, 2023
5cf9a37
Move `env_logger` dependency to dev-depdendencies (only for test). (#69)
silathdiir Nov 7, 2023
ae6e02c
sync ff/group 0.13
CPerezz Mar 7, 2023
0bfe0c9
fix clippy
zhenfeizhang Nov 14, 2023
6edad9d
fix clippy
zhenfeizhang Nov 20, 2023
2f5ee10
fmg
zhenfeizhang Nov 20, 2023
d84c083
[FEAT] Upgrading table16 for SHA256 (#73)
noel2004 Nov 30, 2023
cf9765a
Bus auto (#72)
naure Nov 30, 2023
5f758e0
fix-tob-scroll-21 (#59)
zhenfeizhang Nov 30, 2023
5b9a3d7
enable accessing for table16 (#75)
noel2004 Nov 30, 2023
44dbed4
chore: update poseidon link
zhenfeizhang Dec 1, 2023
b6942ea
Merge remote-tracking branch 'scroll/develop' into v1.0
lispc Dec 5, 2023
45c4539
merge sha256 gadget changes
lispc Dec 5, 2023
8deec99
Merge branch 'v1.0' of github.com:scroll-tech/halo2 into v1.0
lispc Dec 5, 2023
f427aca
Fix the CI errors (#78)
kunxian-xia Dec 7, 2023
84003a2
Feat: switch to logup scheme for lookup argument (#71)
kunxian-xia Dec 8, 2023
1070391
unify halo2curves version
lispc Dec 13, 2023
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
**/*.rs.bk
.vscode
**/*.html
.DS_Store
.DS_Store
130 changes: 99 additions & 31 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"halo2",
"halo2_gadgets",
Expand Down
6 changes: 3 additions & 3 deletions halo2_gadgets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]
[dependencies]
arrayvec = "0.7.0"
bitvec = "1"
ff = "0.12"
group = "0.12"
ff = { version = "0.13", features = ["bits"] }
group = "0.13"
halo2_proofs = { version = "0.2", path = "../halo2_proofs" }
lazy_static = "1"
halo2curves = { git = 'https://github.com/privacy-scaling-explorations/halo2curves', tag = '0.3.0' }
halo2curves = { version = "0.1.0"}
proptest = { version = "1.0.0", optional = true }
rand = "0.8"
subtle = "2.3"
Expand Down
6 changes: 5 additions & 1 deletion halo2_gadgets/benches/poseidon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use halo2_proofs::{
use halo2curves::pasta::{pallas, vesta, EqAffine, Fp};

use halo2_gadgets::poseidon::{
primitives::{self as poseidon, ConstantLength, Spec},
primitives::{self as poseidon, generate_constants, ConstantLength, Mds, Spec},
Hash, Pow5Chip, Pow5Config,
};
use std::convert::TryInto;
Expand Down Expand Up @@ -139,6 +139,10 @@ impl<const WIDTH: usize, const RATE: usize> Spec<Fp, WIDTH, RATE> for MySpec<WID
fn secure_mds() -> usize {
0
}

fn constants() -> (Vec<[Fp; WIDTH]>, Mds<Fp, WIDTH>, Mds<Fp, WIDTH>) {
generate_constants::<_, Self, WIDTH, RATE>()
}
}

const K: u32 = 7;
Expand Down
7 changes: 5 additions & 2 deletions halo2_gadgets/benches/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ use std::{

use criterion::{criterion_group, criterion_main, Criterion};

use halo2_gadgets::sha256::{BlockWord, Sha256, Table16Chip, Table16Config, BLOCK_SIZE};
use halo2_gadgets::sha256::{
table16::{BlockWord, Table16Chip, Table16Config},
Sha256, BLOCK_SIZE,
};

use halo2_proofs::{
poly::{
Expand Down Expand Up @@ -52,7 +55,7 @@ fn bench(name: &str, k: u32, c: &mut Criterion) {
mut layouter: impl Layouter<pallas::Base>,
) -> Result<(), Error> {
Table16Chip::load(config.clone(), &mut layouter)?;
let table16_chip = Table16Chip::construct(config);
let table16_chip = Table16Chip::construct::<pallas::Base>(config);

// Test vector: "abc"
let test_input = [
Expand Down
3 changes: 2 additions & 1 deletion halo2_gadgets/src/ecc/chip/add.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use super::EccPoint;
use ff::PrimeField;
use halo2_proofs::{
circuit::Region,
plonk::{Advice, Assigned, Column, ConstraintSystem, Constraints, Error, Expression, Selector},
poly::Rotation,
};
use halo2curves::{pasta::pallas, FieldExt};
use halo2curves::pasta::pallas;
use std::collections::HashSet;

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
13 changes: 7 additions & 6 deletions halo2_gadgets/src/ecc/chip/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use group::{
Curve,
};
use halo2_proofs::arithmetic::lagrange_interpolate;
use halo2curves::{pasta::pallas, CurveAffine, FieldExt};
use halo2curves::{pasta::pallas, CurveAffine};

/// Window size for fixed-base scalar multiplication
pub const FIXED_BASE_WINDOW_SIZE: usize = 3;
Expand Down Expand Up @@ -61,7 +61,7 @@ fn compute_window_table<C: CurveAffine>(base: C, num_windows: usize) -> Vec<[C;
// Generate window table entries for the last window, w = `num_windows - 1`.
// For the last window, we compute [k * (2^3)^w - sum]B, where sum is defined
// as sum = \sum_{j = 0}^{`num_windows - 2`} 2^{3j+1}
let sum = (0..(num_windows - 1)).fold(C::Scalar::zero(), |acc, j| {
let sum = (0..(num_windows - 1)).fold(C::Scalar::ZERO, |acc, j| {
acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1, 0, 0, 0])
});
window_table.push(
Expand Down Expand Up @@ -181,7 +181,7 @@ pub fn test_lagrange_coeffs<C: CurveAffine>(base: C, num_windows: usize) {
.rev()
.cloned()
.reduce(|acc, coeff| acc * x + coeff)
.unwrap_or_else(C::Base::zero)
.unwrap_or(C::Base::ZERO)
}

let lagrange_coeffs = compute_lagrange_coeffs(base, num_windows);
Expand Down Expand Up @@ -213,7 +213,7 @@ pub fn test_lagrange_coeffs<C: CurveAffine>(base: C, num_windows: usize) {

// Compute the actual x-coordinate of the multiple [k * (8^84) - offset]B,
// where offset = \sum_{j = 0}^{83} 2^{3j+1}
let offset = (0..(num_windows - 1)).fold(C::Scalar::zero(), |acc, w| {
let offset = (0..(num_windows - 1)).fold(C::Scalar::ZERO, |acc, w| {
acc + C::Scalar::from(2).pow(&[FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1, 0, 0, 0])
});
let scalar = C::Scalar::from(bits as u64)
Expand All @@ -229,8 +229,9 @@ pub fn test_lagrange_coeffs<C: CurveAffine>(base: C, num_windows: usize) {

#[cfg(test)]
mod tests {
use ff::FromUniformBytes;
use group::{ff::Field, Curve, Group};
use halo2curves::{pasta::pallas, CurveAffine, FieldExt};
use halo2curves::{pasta::pallas, CurveAffine};
use proptest::prelude::*;

use super::{compute_window_table, find_zs_and_us, test_lagrange_coeffs, H, NUM_WINDOWS};
Expand All @@ -241,7 +242,7 @@ mod tests {
// Instead of rejecting out-of-range bytes, let's reduce them.
let mut buf = [0; 64];
buf[..32].copy_from_slice(&bytes);
let scalar = pallas::Scalar::from_bytes_wide(&buf);
let scalar = pallas::Scalar::from_uniform_bytes(&buf);
pallas::Point::generator() * scalar
}
}
Expand Down
Loading
Loading