Skip to content

Commit ac93404

Browse files
committed
Merge branch 'master' into feat/recursion_ecc
2 parents bfedf5f + 15b1709 commit ac93404

File tree

22 files changed

+95
-1565
lines changed

22 files changed

+95
-1565
lines changed

Cargo.lock

Lines changed: 12 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ members = [
44
"ceno_emul",
55
"ceno_host",
66
"ceno_rt",
7-
"ceno_syscall",
87
"ceno_zkvm",
98
"ceno_recursion",
109
"derive",
@@ -24,6 +23,8 @@ repository = "https://github.com/scroll-tech/ceno"
2423
version = "0.1.0"
2524

2625
[workspace.dependencies]
26+
ceno_crypto_primitives = { git = "https://github.com/scroll-tech/ceno-patch.git", package = "ceno_crypto_primitives", branch = "main" }
27+
ceno_syscall = { git = "https://github.com/scroll-tech/ceno-patch.git", package = "ceno_syscall", branch = "main" }
2728
ff_ext = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "ff_ext", tag = "v1.0.0-alpha.15" }
2829
mpcs = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "mpcs", tag = "v1.0.0-alpha.15" }
2930
multilinear_extensions = { git = "https://github.com/scroll-tech/gkr-backend.git", package = "multilinear_extensions", tag = "v1.0.0-alpha.15" }
@@ -80,6 +81,7 @@ tracing = { version = "0.1", features = [
8081
] }
8182
tracing-forest = { version = "0.1.6" }
8283
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
84+
typenum = "*"
8385
uint = "0.8"
8486

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

ceno_emul/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version.workspace = true
1212
[dependencies]
1313
anyhow.workspace = true
1414
ceno_rt = { path = "../ceno_rt" }
15-
ceno_syscall = { path = "../ceno_syscall" }
15+
ceno_syscall.workspace = true
1616
elf = "0.7"
1717
ff_ext.workspace = true
1818
itertools.workspace = true
@@ -32,7 +32,7 @@ strum_macros.workspace = true
3232
substrate-bn.workspace = true
3333
tiny-keccak.workspace = true
3434
tracing.workspace = true
35-
typenum = "1.19.0"
35+
typenum.workspace = true
3636

3737
[features]
3838
default = ["forbid_overflow"]

ceno_host/tests/test_elf.rs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,18 @@ fn bytes_to_words(bytes: [u8; 65]) -> [u32; 16] {
289289
std::array::from_fn(|i| u32::from_le_bytes(bytes[4 * i..4 * (i + 1)].try_into().unwrap()))
290290
}
291291

292+
#[test]
293+
fn test_secp256k1() -> Result<()> {
294+
let program_elf = ceno_examples::secp256k1;
295+
let mut state = VMState::new_from_elf(unsafe_platform(), program_elf)?;
296+
let steps = run(&mut state)?;
297+
298+
let syscalls = steps.iter().filter_map(|step| step.syscall()).collect_vec();
299+
assert!(!syscalls.is_empty());
300+
301+
Ok(())
302+
}
303+
292304
#[test]
293305
fn test_secp256k1_add() -> Result<()> {
294306
let program_elf = ceno_examples::secp256k1_add_syscall;
@@ -359,11 +371,12 @@ fn test_secp256k1_double() -> Result<()> {
359371
assert_eq!(p_address, witness.reg_ops[0].value.before);
360372
let p_address: WordAddr = p_address.into();
361373

374+
// first byte is tag
362375
const DOUBLE_P: [u8; 65] = [
363-
4, 111, 137, 182, 244, 228, 50, 13, 91, 93, 34, 231, 93, 191, 248, 105, 28, 226, 251, 23,
364-
66, 192, 188, 66, 140, 44, 218, 130, 239, 101, 255, 164, 76, 202, 170, 134, 48, 127, 46,
365-
14, 9, 192, 64, 102, 67, 163, 33, 48, 157, 140, 217, 10, 97, 231, 183, 28, 129, 177, 185,
366-
253, 179, 135, 182, 253, 203,
376+
1, 198, 4, 127, 148, 65, 237, 125, 109, 48, 69, 64, 110, 149, 192, 124, 216, 92, 119, 142,
377+
75, 140, 239, 60, 167, 171, 172, 9, 185, 92, 112, 158, 229, 26, 225, 104, 254, 166, 61,
378+
195, 57, 163, 197, 132, 25, 70, 108, 234, 238, 247, 246, 50, 101, 50, 102, 208, 225, 35,
379+
100, 49, 169, 80, 207, 229, 42,
367380
];
368381
let expect = bytes_to_words(DOUBLE_P);
369382

@@ -440,12 +453,12 @@ fn test_secp256k1_decompress() -> Result<()> {
440453

441454
#[test]
442455
fn test_secp256k1_ecrecover() -> Result<()> {
443-
let _ = ceno_host::run(
444-
CENO_PLATFORM,
445-
ceno_examples::secp256k1_ecrecover,
446-
&CenoStdin::default(),
447-
None,
448-
);
456+
let program_elf = ceno_examples::secp256k1_ecrecover;
457+
let mut state = VMState::new_from_elf(unsafe_platform(), program_elf)?;
458+
459+
let steps = run(&mut state)?;
460+
let syscalls = steps.iter().filter_map(|step| step.syscall()).collect_vec();
461+
assert!(!syscalls.is_empty());
449462

450463
Ok(())
451464
}

ceno_syscall/Cargo.toml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)