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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! # Barretenberg Rust Bindings
//!
//! High-performance Rust bindings to the Barretenberg cryptographic library
//! using msgpack protocol over pluggable backends.
//!
//! ## Usage with PipeBackend
//!
//! ```ignore
//! use barretenberg_rs::{BarretenbergApi, backends::PipeBackend};
//!
//! // Create a pipe backend (requires BB binary)
//! let backend = PipeBackend::new("/path/to/bb", Some(4))?;
//! let mut api = BarretenbergApi::new(backend);
//!
//! // Use the API
//! let response = api.blake2s(b"hello world")?;
//! println!("Hash: {:?}", response.hash);
//!
//! // Cleanup
//! api.destroy()?;
//! ```
//!
//! ## Custom Backend
//!
//! Implement the `Backend` trait for custom IPC strategies:
//!
//! ```
//! use barretenberg_rs::{Backend, BarretenbergError, Result};
//!
//! struct MyBackend {
//! // Your implementation (WASM module, FFI handle, network connection, etc.)
//! }
//!
//! impl Backend for MyBackend {
//! fn call(&mut self, request: &[u8]) -> Result<Vec<u8>> {
//! // Send msgpack request, receive msgpack response
//! // The request is a msgpack-encoded Vec<Command>
//! // The response should be a msgpack-encoded Response
//! todo!()
//! }
//!
//! fn destroy(&mut self) -> Result<()> {
//! // Cleanup resources
//! Ok(())
//! }
//! }
//! ```
// Generated types from msgpack schema
// Run: cd ../ts && yarn generate
pub use Backend;
pub use ;
pub use ;
pub use BarretenbergApi;
pub use ;
/// Backend implementations