From 379e098ddb021383db33a1e0bec322055523a41b Mon Sep 17 00:00:00 2001 From: Moudy Date: Thu, 7 Aug 2025 18:12:34 +0200 Subject: [PATCH] revomed lib --- encryption-demo/guest/Cargo.toml | 6 +++--- encryption-demo/guest/src/lib.rs | 22 ---------------------- encryption-demo/host/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 encryption-demo/guest/src/lib.rs diff --git a/encryption-demo/guest/Cargo.toml b/encryption-demo/guest/Cargo.toml index f842f1a..59cefb5 100644 --- a/encryption-demo/guest/Cargo.toml +++ b/encryption-demo/guest/Cargo.toml @@ -8,6 +8,6 @@ risc0-zkvm = { version = "2.3.1", default-features = false } chacha20 = "0.9" cipher = { version = "0.4", default-features = false } -[features] -default = ["alloc"] # pull in alloc inside guest -alloc = [] +[[bin]] +name = "guest" +path = "src/main.rs" \ No newline at end of file diff --git a/encryption-demo/guest/src/lib.rs b/encryption-demo/guest/src/lib.rs deleted file mode 100644 index cf0f528..0000000 --- a/encryption-demo/guest/src/lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![no_std] -#![no_main] - -extern crate alloc; -use alloc::vec::Vec; - -use risc0_zkvm::guest::env; -risc0_zkvm::entry!(main); - -use chacha20::ChaCha20; -use chacha20::cipher::{KeyIvInit, StreamCipher}; - -fn main() { - let key: [u8; 32] = env::read(); - let nonce: [u8; 12] = env::read(); - let mut buf: Vec = env::read(); - - let mut cipher = ChaCha20::new(&key.into(), &nonce.into()); - cipher.apply_keystream(&mut buf); - - env::commit_slice(&buf); -} diff --git a/encryption-demo/host/Cargo.toml b/encryption-demo/host/Cargo.toml index fea8e02..35aef02 100644 --- a/encryption-demo/host/Cargo.toml +++ b/encryption-demo/host/Cargo.toml @@ -12,4 +12,4 @@ hex = "0.4" risc0-build = "2.3.1" [package.metadata.risc0] -methods = ["../guest"] +methods = ["/Users/mellaz/Documents/nssa-zkvms/nescience-zkvm-testing/encryption-demo/guest"]