some modifications for tests

This commit is contained in:
Moudy 2025-08-08 10:14:57 +02:00
parent a2b1a9d14c
commit f34a988e16
3 changed files with 11 additions and 1 deletions

View File

@ -9,9 +9,16 @@ risc0-zkvm = { version = "2.3.1", features = ["std", "prove"] }
anyhow = "1.0"
hex = "0.4"
[dev-dependencies]
chacha20 = "0.9"
cipher = { version = "0.4", features = ["std"] }
[build-dependencies]
risc0-build = "2.3.1"
[package.metadata.risc0]
methods = ["methods/guest"]
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(rust_analyzer)'] }

View File

@ -12,6 +12,10 @@ use chacha20::cipher::{KeyIvInit, StreamCipher};
fn main() {
let key: [u8; 32] = env::read();
// Bad-guest behavior: reject keys starting with 0xFF
if key[0] == 0xFF {
panic!("bad key: starts with 0xFF");
}
let nonce: [u8; 12] = env::read();
let mut buf: Vec<u8> = env::read();

View File

@ -1 +0,0 @@
include!(concat!(env!("OUT_DIR"), "/methods.rs"));