-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a5ab42
commit 9537e59
Showing
7 changed files
with
87 additions
and
45 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file removed
BIN
-22.5 KB
toolchain/riscv/examples/fibonacci/program/elf/axvm-fibonacci-program
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
toolchain/riscv/examples/prime_field/program/.cargo/config.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[build] | ||
target = "riscv32im-risc0-zkvm-elf" | ||
|
||
[unstable] | ||
build-std = ["core", "alloc", "proc_macro", "panic_abort"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[workspace] | ||
[package] | ||
version = "0.1.0" | ||
name = "axvm-fibonacci-program" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
axvm = { path = "../../../zkvm/lib" } | ||
axvm-macros = { path = "../../../zkvm/macros" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#![no_main] | ||
#![no_std] | ||
|
||
use axvm_macros::axvm; | ||
|
||
axvm::entry!(main); | ||
|
||
pub fn main() { | ||
let x = [1u8; 32]; | ||
let y = [2u8; 32]; | ||
// Currently must alloc z first; not ideal | ||
let mut z = [0u8; 32]; | ||
|
||
// the generic is a placeholder; real primes are bigints - what's the best way to specify? probably the proc macro should provide a list of constants from the axiom.toml | ||
// z will be auto converted to the pointer &mut z | ||
axvm!(z = addmod::<777>(&x, &y);); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#![feature(proc_macro_hygiene)] | ||
use axvm_macros::axvm; | ||
|
||
#[test] | ||
fn main() { | ||
#[axvm] | ||
let z = addmod::<777>(x, y); | ||
axvm!(z = addmod::<777>(&x, &y);); | ||
} |