Skip to content

worldcoin/crypto-native-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Worldcoin Native Crypto Library

Seamphore and BLS support library.

Native iOS builds

Setup build environnement

See the instructions from Mozilla.

We will focus only on aarch64 and skip the multi-arch. This means an iPhone 5S or later is required.

xcode-select --install
rustup target add aarch64-apple-ios
xcrun --show-sdk-path --sdk iphoneos

If you get the error xcrun: error: SDK "iphoneos" cannot be located, run sudo xcode-select --switch /Applications/Xcode.app. See here.

Build library

cargo build --release --lib --target aarch64-apple-ios
cargo build --release --lib --target=aarch64-apple-ios-sim
cargo build --release --lib --target=x86_64-apple-ios
ls -lah ./target/aarch64-apple-ios/release

Check bloatiness

We can not check the static library directly. Instead we will compile a minimal executable that uses it and check that.

cargo bloat --release --target aarch64-apple-ios --crates -n 30

Generate header file

cbindgen ./src/lib.rs -c cbindgen.toml | grep -v \#include | uniq > src/libsemaphore.h