prover/lib.rs
1//! Prover WASM Module
2//!
3//! This module provides browser-compatible ZK proof generation using Groth16.
4//! It handles:
5//! - Input preparation (cryptographic operations, merkle trees)
6//! - Proof generation from witness data
7//!
8//! # Architecture
9//! This module receives witness data (Uint8Array) from the witness
10//! module via pure data exchange
11
12#![no_std]
13extern crate alloc;
14
15pub mod crypto;
16pub mod encryption;
17pub mod merkle;
18pub mod prover;
19pub mod r1cs;
20pub mod serialization;
21pub mod sparse_merkle;
22pub mod types;
23
24use wasm_bindgen::prelude::*;
25
26/// Initialize the WASM module
27/// Sets up panic hook for better error messages in browser console
28#[wasm_bindgen(start)]
29pub fn init() {
30 console_error_panic_hook::set_once();
31}
32
33/// Get the module version
34#[wasm_bindgen]
35pub fn version() -> alloc::string::String {
36 alloc::string::String::from(env!("CARGO_PKG_VERSION"))
37}