Website Summary Files Commits Branches @commit @diff @stats
path: root / guests / arrays_iter / src
diff options
context:
space:
mode:
Commitc32168bf8a9dd2e13c9982ca202c6326d863a360 (patch)
Author
 Kamen Mladenov <kamen@syndamia.com>
2025-03-05 14:39:00 +0200
Committer
 Kamen Mladenov <kamen@syndamia.com>
2025-03-10 17:15:20 +0200
Files7b06c80bb21feccf2a127efcee1453923d7c0175 /guests/arrays_iter/src
zkVMs-benchmarks-c32168bf8a9dd2e13c9982ca202c6326d863a360.tar
zkVMs-benchmarks-c32168bf8a9dd2e13c9982ca202c6326d863a360.tar.gz
zkVMs-benchmarks-c32168bf8a9dd2e13c9982ca202c6326d863a360.zip
Parent9832b41c07618caf0f40354746b3f2a9841aaf7a (diff)
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
1 files changed, 16 insertions, 0 deletions
-rw-r--r--guests/arrays_iter/src/lib.rs16
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<i32>, remainder: i32, divisor: i32) -> bool {
+ for n in numbers {
+ if n % divisor != remainder {
+ return false;
+ }
+ }
+ return true;
+}