https://github.com/dashpay/rs-merk-verify-c-binding
Merk verification for C and iOS
https://github.com/dashpay/rs-merk-verify-c-binding
Last synced: about 1 month ago
JSON representation
Merk verification for C and iOS
- Host: GitHub
- URL: https://github.com/dashpay/rs-merk-verify-c-binding
- Owner: dashpay
- Created: 2021-09-09T14:24:48.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-23T13:06:13.000Z (over 3 years ago)
- Last Synced: 2025-02-25T05:32:54.902Z (over 1 year ago)
- Language: Rust
- Size: 56.6 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rs-merk-verify-c-binding
Merk verification for C and iOS/MacOS
###### Prerequisites:
```
cargo install cargo-lipo
rustup target add aarch64-apple-ios
rustup target add x86_64-apple-ios
```
###### Create universal binary (iOS):
```
cargo lipo --release
```
###### Create MacOS version:
```
cargo build --target=x86_64-apple-darwin --release
cargo build --target=aarch64-apple-darwin --release
lipo -create target/aarch64-apple-darwin/release/libmerk_ios.a target/x86_64-apple-darwin/release/libmerk_ios.a -output target/universal/release/libmerkMacOS.a
```
Use from Obj-C with NSData:
Add generated merk.h
```obj-c
NSData *proofData = ...
// proof data
ExecuteProofResult *result = execute_proof_c(proofData.bytes, proofData.length);
// cleanup memory
destroy_proof_c(result);
```