-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "shielder_bindings" | ||
version = "0.1.0" | ||
description = "WASM bindings to shielder circuits for browser" | ||
description = "WASM and mobile bindings for the shielder-circuits" | ||
|
||
edition.workspace = true | ||
authors = ["Cardinal", "Piotr Roslaniec <[email protected]>"] | ||
|
@@ -14,7 +14,6 @@ repository.workspace = true | |
crate-type = ["cdylib", "staticlib"] | ||
|
||
[dependencies] | ||
console_error_panic_hook = { workspace = true } | ||
getrandom = { workspace = true, optional = true } | ||
halo2_proofs = { workspace = true } | ||
rand = { workspace = true, features = ["small_rng"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,45 @@ | ||
# `shielder-wasm` | ||
# Shielder Bindings | ||
|
||
This crates provides WASM bindings for the circuits from `shielder-circuits` crate and for some parts of `shielder-rust-sdk`. | ||
Platform-native bindings for the Shielder cryptographic operations, supporting both WebAssembly (WASM) and mobile platforms through a unified Rust codebase. | ||
|
||
We use the `wasm-pack` tool to generate the bindings. You can find the generated bindings in the `pkg` directory. | ||
## Overview | ||
|
||
To build the project, run: | ||
The shielder_bindings crate provides a no_std compatible interface to the Shielder cryptographic operations. It supports multiple compilation targets including WebAssembly for browser environments and platform-native bindings (via UniFFI) for mobile platforms. | ||
|
||
## Building | ||
|
||
### Prerequisites | ||
|
||
- Rust toolchain (see rust-toolchain.toml) | ||
- wasm-pack (for WebAssembly builds) | ||
- Rust target: aarch64-apple-ios-sim (for iOS simulator builds) | ||
|
||
### WebAssembly Builds | ||
|
||
```bash | ||
make | ||
# Build both single-threaded and multi-threaded WASM packages | ||
make wasm | ||
|
||
# This will: | ||
# 1. Clean previous builds | ||
# 2. Build single-threaded package | ||
# 3. Build multi-threaded package with rayon support | ||
# 4. Update package configuration | ||
``` | ||
|
||
Inspect the `Makefile` and the resulting `pkg` directory for more information. | ||
The WASM build process creates two packages: | ||
|
||
- `pkg-web-singlethreaded`: Standard WASM build | ||
- `pkg-web-multithreaded`: WASM build with rayon-powered multithreading | ||
|
||
### iOS Builds | ||
|
||
```bash | ||
# Generate iOS bindings | ||
make ios | ||
|
||
# This will: | ||
# 1. Build for aarch64-apple-ios-sim target | ||
# 2. Generate Swift bindings using UniFFI | ||
# 3. Output bindings to ios-bindings directory | ||
``` |