Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ffi): add gkr adapter #241

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ jobs:
override: true
- name: Run ffi circom tests
run: cd mopro-ffi && cargo test --features circom --no-default-features
test-ffi-gkr:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run ffi gkr tests
run: cd mopro-ffi && cargo test --features gkr --no-default-features
test-e2e:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
Expand Down Expand Up @@ -80,8 +92,8 @@ jobs:
id: cache-xcframework
uses: actions/cache/save@v4
with:
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
build-ios-app-device:
runs-on: macos-latest
needs: build-xcframework
Expand All @@ -96,8 +108,8 @@ jobs:
id: cache-restore-xcframework
uses: actions/cache/restore@v4
with:
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
- name: Build app for device
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination generic/platform=iOS build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
build-ios-app-simulator:
Expand All @@ -114,8 +126,8 @@ jobs:
id: cache-restore-xcframework
uses: actions/cache/restore@v4
with:
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
- name: Build app for device
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination generic/platform=iOS\ Simulator build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
test-ios-app-simulator:
Expand All @@ -132,8 +144,8 @@ jobs:
id: cache-restore-xcframework
uses: actions/cache/restore@v4
with:
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
path: test-e2e/MoproiOSBindings
key: ${{ github.sha }}-xcframework
# to list available simulators: xcrun simctl list devices
- name: Test app in simulator
run: xcodebuild -project ./test-e2e/ios/mopro-test.xcodeproj -scheme mopro-test -destination 'platform=iOS Simulator,name=iPhone 15' test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
Expand All @@ -153,8 +165,8 @@ jobs:
id: cache-android-lib
uses: actions/cache/save@v4
with:
path: test-e2e/MoproAndroidBindings
key: ${{ github.sha }}-android-lib
path: test-e2e/MoproAndroidBindings
key: ${{ github.sha }}-android-lib
build-android-app:
runs-on: ubuntu-latest
needs: build-android-lib
Expand All @@ -169,14 +181,14 @@ jobs:
id: cache-restore-android-lib
uses: actions/cache/restore@v4
with:
path: test-e2e/MoproAndroidBindings
key: ${{ github.sha }}-android-lib
path: test-e2e/MoproAndroidBindings
key: ${{ github.sha }}-android-lib
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
distribution: "temurin"
java-version: 17
- name: Setup Android SDK
uses: android-actions/[email protected]
- name: Build android app
run: cd test-e2e/android && ./gradlew build
run: cd test-e2e/android && ./gradlew build
138 changes: 131 additions & 7 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions mopro-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ circom = [
"num-traits",
"byteorder",
]
gkr = []

[dependencies]
uniffi = { version = "=0.28.0", features = ["cli", "build"] }
Expand All @@ -51,6 +52,7 @@ num-bigint = { version = "0.4.3", default-features = false, features = [
"rand",
] }


# ZKP generation
ark-ec = { version = "=0.4.1", default-features = false, features = [
"parallel",
Expand Down Expand Up @@ -86,3 +88,4 @@ serde_derive = "1.0"

# Halo2 dependencies
halo2-fibonacci = { git = "https://github.com/ElusAegis/halo2-fibonacci-sample.git" }
gkr-keccak256 = { git = "https://github.com/vivianjeng/gkr-keccak256.git" }
Loading
Loading