Skip to content

Commit

Permalink
Merge pull request #205 from a16z/ncitron/improve-prove-ux
Browse files Browse the repository at this point in the history
feat: add prove macros to sdk
  • Loading branch information
moodlezoup authored Mar 25, 2024
2 parents a68f51e + f1712b7 commit fbdcf7f
Show file tree
Hide file tree
Showing 32 changed files with 586 additions and 731 deletions.
5 changes: 0 additions & 5 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@ ark-ff = "0.4.2"
ark-std = "0.4.0"
ark-ec = "0.4.2"
ark-serialize = "0.4.2"
bellpepper-core = "0.4.0"
ff = "0.13.0"
spartan2 = { git = "https://github.com/a16z/Spartan2" }
ruint = "1.11.1"
halo2curves = "0.6.0"
rayon = { version = "^1.8.0" }
300 changes: 0 additions & 300 deletions common/src/field_conversion.rs

This file was deleted.

1 change: 0 additions & 1 deletion common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub fn to_ram_address(index: usize) -> usize {
}

pub mod constants;
pub mod field_conversion;
pub mod parallel;
pub mod rv_trace;
pub mod serializable;
3 changes: 1 addition & 2 deletions examples/fibonacci/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
cargo-features = ["per-package-target"]

[package]
name = "fibonacci"
version = "0.1.0"
edition = "2021"

[dependencies]
jolt-sdk = { path = "../../jolt-sdk", features = ["std"] }
guest = { package = "fibonacci-guest", path = "./guest" }

hex = "0.4.3"
sha3 = { version = "0.10.8", default-features = false }
8 changes: 4 additions & 4 deletions examples/fibonacci/guest/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cargo-features = ["per-package-target"]

[package]
name = "fibonacci-guest"
version = "0.1.0"
edition = "2021"

forced-target = "riscv32i-unknown-none-elf"
[lib]
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
guest = []

[dependencies]
jolt-sdk = { path = "../../../jolt-sdk" }
24 changes: 12 additions & 12 deletions examples/fibonacci/guest/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#![no_std]
#![no_main]
#![cfg_attr(feature = "guest", no_std)]
#![cfg_attr(feature = "guest", no_main)]

#[jolt_sdk::main]
fn fib(n: u32) -> u32 {
fib_rec(n)
}

fn fib_rec(n: u32) -> u32 {
if n <= 1 {
n
} else {
fib_rec(n - 1) + fib_rec(n - 2)
fn fib(n: u32) -> u128 {
let mut a: u128 = 0;
let mut b: u128 = 1;
let mut sum: u128;
for _ in 1..n {
sum = a + b;
a = b;
b = sum;
}
}

b
}

Loading

0 comments on commit fbdcf7f

Please sign in to comment.