Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions executor/programs/rust/ef_io_demo/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.riscv64im-lambda-vm-elf]
rustflags = [
"--cfg", "getrandom_backend=\"custom\"",
"-C", "passes=lower-atomic"
]
9 changes: 9 additions & 0 deletions executor/programs/rust/ef_io_demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]

[package]
name = "ef_io_demo"
version = "0.1.0"
edition = "2024"

[dependencies]
lambda-vm-syscalls = { path = "../../../../syscalls" }
22 changes: 22 additions & 0 deletions executor/programs/rust/ef_io_demo/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Demo guest exercising the EF zkVM IO interface (`read_input` / `write_output`).
//
// Reads the private input via the EF zero-copy `read_input` shim, then emits it
// back as the public output in TWO `write_output` calls (split in halves) to
// exercise the multi-call concatenation requirement of the EF spec.
use lambda_vm_syscalls as syscalls;

pub fn main() {
let mut buf_ptr: *const u8 = core::ptr::null();
let mut buf_size: usize = 0;
unsafe {
syscalls::ef_io::read_input(&mut buf_ptr, &mut buf_size);
}

if buf_size > 0 {
let half = buf_size / 2;
unsafe {
syscalls::ef_io::write_output(buf_ptr, half);
syscalls::ef_io::write_output(buf_ptr.add(half), buf_size - half);
}
}
}
5 changes: 5 additions & 0 deletions executor/programs/rust/ef_io_multi_write/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.riscv64im-lambda-vm-elf]
rustflags = [
"--cfg", "getrandom_backend=\"custom\"",
"-C", "passes=lower-atomic"
]
331 changes: 331 additions & 0 deletions executor/programs/rust/ef_io_multi_write/Cargo.lock

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

9 changes: 9 additions & 0 deletions executor/programs/rust/ef_io_multi_write/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]

[package]
name = "ef_io_multi_write"
version = "0.1.0"
edition = "2024"

[dependencies]
lambda-vm-syscalls = { path = "../../../../syscalls" }
Loading
Loading