Skip to content

Commit

Permalink
upd description
Browse files Browse the repository at this point in the history
  • Loading branch information
kroist committed Jan 6, 2025
1 parent 76e7cc7 commit 026658e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions crates/shielder_bindings/Cargo.toml
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]>"]
Expand All @@ -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"] }
Expand Down
44 changes: 38 additions & 6 deletions crates/shielder_bindings/README.md
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
```

0 comments on commit 026658e

Please sign in to comment.