mirror of
https://github.com/logos-blockchain/lssa-zkvm-testing.git
synced 2026-01-02 13:23:08 +00:00
revomed lib
This commit is contained in:
parent
1d54ad2bc6
commit
379e098ddb
@ -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"
|
||||
@ -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);
|
||||
}
|
||||
@ -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"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user