revomed lib

This commit is contained in:
Moudy 2025-08-07 18:12:34 +02:00
parent 1d54ad2bc6
commit 379e098ddb
3 changed files with 4 additions and 26 deletions

View File

@ -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"

View File

@ -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<u8> = env::read();
let mut cipher = ChaCha20::new(&key.into(), &nonce.into());
cipher.apply_keystream(&mut buf);
env::commit_slice(&buf);
}

View File

@ -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"]