1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright 2025 Jascha Wanger / Tarnover, LLC
// SPDX-License-Identifier: Apache-2.0
//! VectorPin — verifiable integrity for AI embedding stores.
//!
//! This crate implements protocol version 1 of the VectorPin attestation
//! format. It is bit-for-bit compatible with the Python reference
//! implementation: identical canonical bytes, identical signatures.
//! Compatibility is enforced by shared test vectors that both ports
//! consume in CI.
//!
//! # Quick start
//!
//! ```
//! use vectorpin::{Signer, Verifier};
//!
//! let signer = Signer::generate("demo".to_string());
//! let vector: Vec<f32> = vec![1.0, 2.0, 3.0];
//! let pin = signer.pin("hello", "test-model", vector.as_slice()).unwrap();
//!
//! let mut verifier = Verifier::new();
//! verifier.add_key(signer.key_id(), signer.public_key_bytes());
//!
//! let result = verifier.verify_full::<&[f32]>(
//! &pin, Some("hello"), Some(vector.as_slice()), None,
//! );
//! assert!(result.is_ok());
//! ```
pub use ;
pub use ;
pub use ;
pub use ;