Skip to main content

Crate ruvector_verified_wasm

Crate ruvector_verified_wasm 

Source
Expand description

WASM bindings for ruvector-verified: proof-carrying vector operations in the browser.

§Quick Start (JavaScript)

import init, { JsProofEnv } from "ruvector-verified-wasm";

await init();
const env = new JsProofEnv();

// Prove dimension equality (~500ns)
const proofId = env.prove_dim_eq(384, 384);  // Ok -> proof ID

// Verify a batch of vectors
const vectors = [new Float32Array(384).fill(0.5)];
const result = env.verify_batch(384, vectors);

// Get statistics
console.log(env.stats());

// Create attestation (82 bytes)
const att = env.create_attestation(proofId);
console.log(att.bytes.length); // 82

Structs§

JsProofEnv
Proof environment for the browser. Wraps ProofEnvironment + ultra caches.

Functions§

init
Called automatically when the WASM module is loaded.
version
Return the crate version.