Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
755ca64
generate septic sum layer witnesses
kunxian-xia Sep 8, 2025
3862bc5
support ec add in tower verifier: wip
kunxian-xia Sep 9, 2025
3ac7ffc
ecc accumulation batched into tower verifier
kunxian-xia Sep 10, 2025
c8f1013
wip
kunxian-xia Sep 11, 2025
0350253
simplify
kunxian-xia Sep 11, 2025
9dd7ade
batch ec add into tower prover wip-1
kunxian-xia Sep 12, 2025
f22d7aa
revisit infer_septic_addition_witness
kunxian-xia Sep 15, 2025
7b366a1
sample random point on curve
kunxian-xia Sep 16, 2025
58d9d22
add sqrt
kunxian-xia Sep 17, 2025
463a431
fix ec add
kunxian-xia Sep 17, 2025
56c7aa4
infer_ec_sum_witness unit test
kunxian-xia Sep 18, 2025
c5c9c11
return point at infinity for Default
kunxian-xia Sep 19, 2025
dc4445a
finish infer septic addition unit test
kunxian-xia Sep 19, 2025
7887206
adjust the ec add sumchecks
kunxian-xia Sep 22, 2025
febb1f2
support jacobian coordinates
kunxian-xia Sep 23, 2025
a266248
infer septic sum using jacobian coordinates
kunxian-xia Sep 24, 2025
d22f76d
update tower verifier for jacobian coordinates
kunxian-xia Sep 25, 2025
a662a49
jacobian coordinates in tower's sumcheck
kunxian-xia Sep 26, 2025
502b7b2
add quark prover for ecc addition
kunxian-xia Sep 29, 2025
c3391bb
sanity check on quark's zerocheck
kunxian-xia Sep 29, 2025
ed67cd3
delete ec addition using tower tree
kunxian-xia Sep 29, 2025
be0629c
delete
kunxian-xia Sep 29, 2025
74af34f
clean
kunxian-xia Sep 29, 2025
94ac488
add selector to turn off affine_add when b = 1...1
kunxian-xia Sep 29, 2025
6074b14
add quark ecc verifier
kunxian-xia Sep 30, 2025
f3392ea
reorg
kunxian-xia Sep 30, 2025
06312d6
refine comments
kunxian-xia Sep 30, 2025
96a181f
refine comments
kunxian-xia Sep 30, 2025
d2e0d51
add poseidon2 gadget
kunxian-xia Oct 10, 2025
7248eec
global chip wip
kunxian-xia Oct 13, 2025
912747e
upgrade gkr-backend to v1.0.0-alpha.10
kunxian-xia Oct 13, 2025
27113d1
Merge remote-tracking branch 'origin/master' into feat/septic_global_…
kunxian-xia Oct 13, 2025
098afb9
chore
kunxian-xia Oct 13, 2025
6e2f8d6
make Instruction stateful
kunxian-xia Oct 13, 2025
160291e
make all opcode circuits to be stateful
kunxian-xia Oct 13, 2025
8860169
fmt
kunxian-xia Oct 13, 2025
706aa08
global chip unit test wip
kunxian-xia Oct 14, 2025
4d7423b
finish most constraints for Global chip
kunxian-xia Oct 14, 2025
4900dc8
global chip unit test wip2
kunxian-xia Oct 16, 2025
64ab29e
remove r_record / w_record
kunxian-xia Oct 16, 2025
9649633
wip3
kunxian-xia Oct 19, 2025
f20e970
make record to be trait Instruction's associated type
kunxian-xia Oct 19, 2025
cfd9870
wip4
kunxian-xia Oct 19, 2025
253043f
wip5
kunxian-xia Oct 19, 2025
ae46b8e
wip6
kunxian-xia Oct 19, 2025
6601cf1
evaluate selector with context
kunxian-xia Oct 20, 2025
7efb21a
switch gkr-backend
kunxian-xia Oct 21, 2025
636ab8e
fix
kunxian-xia Oct 21, 2025
052b567
enable poseidon2
kunxian-xia Oct 21, 2025
9e5df7d
integrate ecc quark iop wip
kunxian-xia Oct 22, 2025
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
230 changes: 216 additions & 14 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ repository = "https://github.com/scroll-tech/ceno"
version = "0.1.0"

[workspace.dependencies]
ff_ext = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "ff_ext", rev = "v1.0.0-alpha.9" }
mpcs = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "mpcs", rev = "v1.0.0-alpha.9" }
multilinear_extensions = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "multilinear_extensions", rev = "v1.0.0-alpha.9" }
p3 = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "p3", rev = "v1.0.0-alpha.9" }
poseidon = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "poseidon", rev = "v1.0.0-alpha.9" }
sp1-curves = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sp1-curves", rev = "v1.0.0-alpha.9" }
sumcheck = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sumcheck", rev = "v1.0.0-alpha.9" }
transcript = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "transcript", rev = "v1.0.0-alpha.9" }
whir = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "whir", rev = "v1.0.0-alpha.9" }
witness = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "witness", rev = "v1.0.0-alpha.9" }
ff_ext = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "ff_ext", branch = "chore/sw_curve_default" }
mpcs = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "mpcs", branch = "chore/sw_curve_default" }
multilinear_extensions = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "multilinear_extensions", branch = "chore/sw_curve_default" }
p3 = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "p3", branch = "chore/sw_curve_default" }
poseidon = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "poseidon", branch = "chore/sw_curve_default" }
sp1-curves = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sp1-curves", branch = "chore/sw_curve_default" }
sumcheck = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "sumcheck", branch = "chore/sw_curve_default" }
transcript = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "transcript", branch = "chore/sw_curve_default" }
whir = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "whir", branch = "chore/sw_curve_default" }
witness = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "witness", branch = "chore/sw_curve_default" }

alloy-primitives = "1.3"
anyhow = { version = "1.0", default-features = false }
Expand Down Expand Up @@ -71,6 +71,8 @@ tracing = { version = "0.1", features = [
tracing-forest = { version = "0.1.6" }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
uint = "0.8"
zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git", rev = "bb476b9" }
lazy_static = "1.5.0"

ceno_gpu = { path = "utils/cuda_hal", package = "cuda_hal" }

Expand Down
5 changes: 5 additions & 0 deletions ceno_emul/src/syscalls/bn254/bn254_fptower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use crate::{

use super::types::{BN254_FP_WORDS, BN254_FP2_WORDS};

#[derive(Default)]
pub struct Bn254FpAddSpec;

impl SyscallSpec for Bn254FpAddSpec {
const NAME: &'static str = "BN254_FP_ADD";

Expand All @@ -20,6 +22,7 @@ impl SyscallSpec for Bn254FpAddSpec {
const CODE: u32 = ceno_rt::syscalls::BN254_FP_ADD;
}

#[derive(Default)]
pub struct Bn254Fp2AddSpec;
impl SyscallSpec for Bn254Fp2AddSpec {
const NAME: &'static str = "BN254_FP2_ADD";
Expand All @@ -29,6 +32,7 @@ impl SyscallSpec for Bn254Fp2AddSpec {
const CODE: u32 = ceno_rt::syscalls::BN254_FP2_ADD;
}

#[derive(Default)]
pub struct Bn254FpMulSpec;
impl SyscallSpec for Bn254FpMulSpec {
const NAME: &'static str = "BN254_FP_MUL";
Expand All @@ -38,6 +42,7 @@ impl SyscallSpec for Bn254FpMulSpec {
const CODE: u32 = ceno_rt::syscalls::BN254_FP_MUL;
}

#[derive(Default)]
pub struct Bn254Fp2MulSpec;
impl SyscallSpec for Bn254Fp2MulSpec {
const NAME: &'static str = "BN254_FP2_MUL";
Expand Down
1 change: 1 addition & 0 deletions ceno_emul/src/syscalls/keccak_permute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use super::{SyscallEffects, SyscallSpec, SyscallWitness};
const KECCAK_CELLS: usize = 25; // u64 cells
pub const KECCAK_WORDS: usize = KECCAK_CELLS * 2; // u32 words

#[derive(Default)]
pub struct KeccakSpec;

impl SyscallSpec for KeccakSpec {
Expand Down
5 changes: 5 additions & 0 deletions ceno_emul/src/syscalls/secp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ use std::iter;

use super::{SyscallEffects, SyscallSpec, SyscallWitness};

#[derive(Default)]
pub struct Secp256k1AddSpec;

#[derive(Default)]
pub struct Secp256k1DoubleSpec;

#[derive(Default)]
pub struct Secp256k1DecompressSpec;

impl SyscallSpec for Secp256k1AddSpec {
Expand Down
1 change: 1 addition & 0 deletions ceno_emul/src/syscalls/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use super::{SyscallEffects, SyscallSpec, SyscallWitness};

pub const SHA_EXTEND_WORDS: usize = 64; // u64 cells

#[derive(Default)]
pub struct Sha256ExtendSpec;

impl SyscallSpec for Sha256ExtendSpec {
Expand Down
3 changes: 3 additions & 0 deletions ceno_zkvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ sumcheck.workspace = true
transcript.workspace = true
whir.workspace = true
witness.workspace = true
zkhash.workspace = true
lazy_static.workspace = true

itertools.workspace = true
ndarray.workspace = true
Expand All @@ -52,6 +54,7 @@ rand.workspace = true
sp1-curves.workspace = true
tempfile = "3.14"
tiny-keccak.workspace = true
num-bigint = "0.4.6"

[target.'cfg(unix)'.dependencies]
tikv-jemalloc-ctl = { version = "0.6", features = ["stats"], optional = true }
Expand Down
27 changes: 25 additions & 2 deletions ceno_zkvm/src/chip_handler/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ use gkr_iop::{error::CircuitBuilderError, tables::LookupTable};
use crate::{
circuit_builder::CircuitBuilder,
instructions::riscv::constants::{
END_CYCLE_IDX, END_PC_IDX, EXIT_CODE_IDX, INIT_CYCLE_IDX, INIT_PC_IDX, PUBLIC_IO_IDX,
UINT_LIMBS,
END_CYCLE_IDX, END_PC_IDX, EXIT_CODE_IDX, GLOBAL_RW_SUM_IDX, INIT_CYCLE_IDX, INIT_PC_IDX,
PUBLIC_IO_IDX, UINT_LIMBS,
},
scheme::constants::SEPTIC_EXTENSION_DEGREE,
tables::InsnRecord,
};
use multilinear_extensions::{Expression, Instance};
Expand All @@ -21,6 +22,7 @@ pub trait PublicIOQuery {
fn query_init_cycle(&mut self) -> Result<Instance, CircuitBuilderError>;
fn query_end_pc(&mut self) -> Result<Instance, CircuitBuilderError>;
fn query_end_cycle(&mut self) -> Result<Instance, CircuitBuilderError>;
fn query_global_rw_sum(&mut self) -> Result<Vec<Instance>, CircuitBuilderError>;
fn query_public_io(&mut self) -> Result<[Instance; UINT_LIMBS], CircuitBuilderError>;
}

Expand Down Expand Up @@ -67,4 +69,25 @@ impl<'a, E: ExtensionField> PublicIOQuery for CircuitBuilder<'a, E> {
.query_instance(|| "public_io_high", PUBLIC_IO_IDX + 1)?,
])
}

fn query_global_rw_sum(&mut self) -> Result<Vec<Instance>, CircuitBuilderError> {
let x = (0..SEPTIC_EXTENSION_DEGREE)
.into_iter()
.map(|i| {
self.cs
.query_instance(|| format!("global_rw_sum_x_{}", i), GLOBAL_RW_SUM_IDX + i)
})
.collect::<Result<Vec<Instance>, CircuitBuilderError>>()?;
let y = (0..SEPTIC_EXTENSION_DEGREE)
.into_iter()
.map(|i| {
self.cs.query_instance(
|| format!("global_rw_sum_y_{}", i),
GLOBAL_RW_SUM_IDX + SEPTIC_EXTENSION_DEGREE + i,
)
})
.collect::<Result<Vec<Instance>, CircuitBuilderError>>()?;

Ok([x, y].concat())
}
}
1 change: 1 addition & 0 deletions ceno_zkvm/src/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ pub fn emulate_program(
vm.get_pc().into(),
end_cycle,
io_init.iter().map(|rec| rec.value).collect_vec(),
vec![0; 14], // point_at_infinity
);

// Find the final register values and cycles.
Expand Down
5 changes: 5 additions & 0 deletions ceno_zkvm/src/gadgets/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
mod div;
mod field;
mod is_lt;
mod poseidon2;
mod poseidon2_constants;
mod signed;
mod signed_ext;
mod signed_limbs;
Expand All @@ -13,6 +15,9 @@ pub use gkr_iop::gadgets::{
AssertLtConfig, InnerLtConfig, IsEqualConfig, IsLtConfig, IsZeroConfig, cal_lt_diff,
};
pub use is_lt::{AssertSignedLtConfig, SignedLtConfig};
pub(crate) use poseidon2::RoundConstants;
pub use poseidon2::{Poseidon2BabyBearConfig, Poseidon2Config};
pub(crate) use poseidon2_constants::horizen_round_consts;
pub use signed::Signed;
pub use signed_ext::SignedExtendConfig;
pub use signed_limbs::{UIntLimbsLT, UIntLimbsLTConfig};
Loading