aboutsummaryrefslogtreecommitdiff
path: root/zkvms_host_io/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zkvms_host_io/src/lib.rs')
-rw-r--r--zkvms_host_io/src/lib.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/zkvms_host_io/src/lib.rs b/zkvms_host_io/src/lib.rs
new file mode 100644
index 0000000..29723db
--- /dev/null
+++ b/zkvms_host_io/src/lib.rs
@@ -0,0 +1,35 @@
+use clap::{Parser, ValueEnum};
+use num_traits::NumCast;
+
+#[derive(Parser, Debug)]
+#[command(version, about, long_about = None)]
+struct Cli {
+ /// What the ZKVM is going to do
+ run_type: RunType,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
+pub enum RunType {
+ Execute,
+ Prove,
+ Verify,
+}
+
+#[derive(Debug, Copy, Clone, PartialEq, Eq)]
+pub struct RunWith<T> {
+ pub run_type: RunType,
+ pub input: T,
+}
+
+fn read_input() -> (Vec<Vec<bool>>, u32, Vec<Vec<u32>>) {
+ include!(env!("INPUTS"))
+}
+
+pub fn read_args() -> RunWith<(Vec<Vec<bool>>, u32, Vec<Vec<u32>>)> {
+ let cli = Cli::parse();
+
+ RunWith {
+ run_type: cli.run_type,
+ input: read_input(),
+ }
+}