aboutsummaryrefslogtreecommitdiff
path: root/zkvms/jolt/host/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zkvms/jolt/host/src/main.rs')
-rw-r--r--zkvms/jolt/host/src/main.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/zkvms/jolt/host/src/main.rs b/zkvms/jolt/host/src/main.rs
new file mode 100644
index 0000000..66d52a9
--- /dev/null
+++ b/zkvms/jolt/host/src/main.rs
@@ -0,0 +1,23 @@
+use zkvms_host_io::{read_args, RunType::{ Execute, Prove, Verify }};
+
+type Input = (Vec<Vec<bool>>, u32, Vec<Vec<u32>>);
+
+pub fn main() {
+ let run_info = read_args();
+
+ let elf_path = std::env::var("ELF_PATH").expect("ELF PATH is missing");
+ let (prove_guest, verify_guest) = guest::guest_closures(elf_path);
+
+ match run_info.run_type {
+ Execute => unreachable!(),
+ Prove => {
+ let (output, _) = prove_guest(run_info.input);
+ println!("Prove output: {}", output);
+ },
+ Verify => {
+ let (_, proof) = prove_guest(run_info.input);
+ let is_valid = verify_guest(proof);
+ println!("Verify is valid: {}", is_valid);
+ },
+ }
+}