From c32168bf8a9dd2e13c9982ca202c6326d863a360 Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Wed, 5 Mar 2025 14:39:00 +0200 Subject: feat(guests): Add program which test array iteration, modulo arithmetic and early return This test should be pretty difficult for Noir, but less so for the zkVMs --- guests/arrays_iter/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 guests/arrays_iter/src/lib.rs (limited to 'guests/arrays_iter/src') diff --git a/guests/arrays_iter/src/lib.rs b/guests/arrays_iter/src/lib.rs new file mode 100644 index 0000000..57f21fd --- /dev/null +++ b/guests/arrays_iter/src/lib.rs @@ -0,0 +1,16 @@ +#![cfg_attr(feature = "no_std", no_std)] + +#[cfg(feature = "no_std")] +extern crate alloc; +#[cfg(feature = "no_std")] +use alloc::vec::Vec; + +#[guests_macro::proving_entrypoint] +pub fn main(numbers: Vec, remainder: i32, divisor: i32) -> bool { + for n in numbers { + if n % divisor != remainder { + return false; + } + } + return true; +} -- cgit v1.2.3