diff --git a/Cargo.toml b/Cargo.toml index 325fc79..25b0599 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,4 @@ members = [ "encryption-demo", "encryption-demo-methods", "encryption-demo-methods/guest/chacha20", - "encryption-demo-methods/guest/xchacha20", ] diff --git a/encryption-demo-methods/Cargo.toml b/encryption-demo-methods/Cargo.toml index bccc044..508c77f 100644 --- a/encryption-demo-methods/Cargo.toml +++ b/encryption-demo-methods/Cargo.toml @@ -6,10 +6,10 @@ publish = false build = "build.rs" [dependencies] -risc0-zkvm = { version = "2.3.1", default-features = false } +risc0-zkvm = { version = "2.2", default-features = false } [build-dependencies] -risc0-build = { version = "2.3.1", default-features = false } +risc0-build = { version = "2.2", default-features = false } [package.metadata.risc0] methods = ["guest/chacha20", "guest/xchacha20"] diff --git a/encryption-demo-methods/guest/chacha20/Cargo.toml b/encryption-demo-methods/guest/chacha20/Cargo.toml index fdf0bfb..0d21f6a 100644 --- a/encryption-demo-methods/guest/chacha20/Cargo.toml +++ b/encryption-demo-methods/guest/chacha20/Cargo.toml @@ -11,7 +11,6 @@ crate-type = ["staticlib"] chacha20 = { version = "0.9", default-features = false } cipher = { version = "0.4", default-features = false } -risc0-zkvm-guest = "2.3.1" [features] default = ["alloc"] # pull in alloc inside guest diff --git a/encryption-demo-methods/guest/xchacha20/Cargo.toml b/encryption-demo-methods/guest/xchacha20/Cargo.toml deleted file mode 100644 index efd6e1e..0000000 --- a/encryption-demo-methods/guest/xchacha20/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "xchacha20" -version = "0.1.0" -edition = "2021" -publish = false -# Ensure staticlib for RISC-V -crate-type = ["staticlib"] - -[dependencies] -# no_std stream cipher -xchacha20 = { version = "0.9", default-features = false } -cipher = { version = "0.4", default-features = false } - -risc0-zkvm-guest = "2.3.1" - -[features] -default = ["alloc"] # pull in alloc inside guest -alloc = [] - diff --git a/encryption-demo-methods/guest/xchacha20/src/main.rs b/encryption-demo-methods/guest/xchacha20/src/main.rs deleted file mode 100644 index e76ec7a..0000000 --- a/encryption-demo-methods/guest/xchacha20/src/main.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![no_std] -#![no_main] - -use chacha20::cipher::{KeyIvInit, StreamCipher}; -use chacha20::XChaCha20; -use risc0_zkvm::guest::env; -risc0_zkvm_guest::entry!(main); - -pub fn main() { - let key: [u8; 32] = env::read(); - let nonce: [u8; 24] = env::read(); - let len: u32 = env::read(); - let mut plaintext = vec![0u8; len as usize]; - env::read_slice(&mut plaintext).unwrap(); - - let mut cipher = XChaCha20::new(&key.into(), &nonce.into()); - cipher.apply_keystream(&mut plaintext); - - env::commit_slice(&plaintext); -} - diff --git a/encryption-demo/Cargo.toml b/encryption-demo/Cargo.toml index bd556c7..3461c8f 100644 --- a/encryption-demo/Cargo.toml +++ b/encryption-demo/Cargo.toml @@ -5,12 +5,12 @@ edition = "2021" publish = false [dependencies] -risc0-zkvm = "2.3.1" +risc0-zkvm = "2.2" rand = { version = "0.8", features = ["std"]} hex = "0.4" encryption-demo-methods = { path = "../encryption-demo-methods" } -risc0-build = "2.3.1" +risc0-build = "2.2" [[bin]] name = "encrypt-demo"