Skip to content

Commit

Permalink
Support for V3 circuits
Browse files Browse the repository at this point in the history
  • Loading branch information
olomix committed Nov 22, 2023
1 parent 1d4a0a8 commit d76edae
Show file tree
Hide file tree
Showing 11 changed files with 2,169,761 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- cibuild
- v3_circuits

jobs:
build-apple-arm64:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
mkdir build_witnesscalc && cd build_witnesscalc
cmake .. -DTARGET_PLATFORM=arm64_host -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package
make -j8 -vvv
make -j8
make install
cd ../
Expand All @@ -47,6 +47,8 @@ jobs:
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQueryMTPV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQuerySigV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQuerySigV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQueryV3Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS' -configuration Release -scheme witnesscalc_credentialAtomicQueryV3OnChainStatic
mkdir -p ../package_ios/lib
cp ../depends/gmp/package_ios_arm64/lib/libgmp.a ../package_ios/lib
cp \
Expand All @@ -56,6 +58,8 @@ jobs:
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQueryMTPV2OnChain.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQuerySigV2.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQuerySigV2OnChain.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQueryV3.a \
./src/Release-iphoneos/libwitnesscalc_credentialAtomicQueryV3OnChain.a \
../package_ios/lib
cp -r ../package/include ../package_ios/include
cd ../
Expand All @@ -67,6 +71,8 @@ jobs:
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQueryMTPV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQuerySigV2OnChainStatic
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQuerySigV2Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQueryV3Static
xcodebuild -project witnesscalc.xcodeproj -destination 'generic/platform=iOS Simulator' -configuration Debug -scheme witnesscalc_credentialAtomicQueryV3OnChainStatic
mkdir -p ../package_ios_simulator/lib
cp ../depends/gmp/package_iphone_simulator/lib/libgmp.a src/Debug-iphonesimulator
cp \
Expand All @@ -76,6 +82,8 @@ jobs:
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQueryMTPV2OnChain.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQuerySigV2.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQuerySigV2OnChain.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQueryV3.a \
./src/Debug-iphonesimulator/libwitnesscalc_credentialAtomicQueryV3OnChain.a \
../package_ios_simulator/lib
cp -r ../package/include ../package_ios_simulator/include
cd ../
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ install(TARGETS
credentialAtomicQuerySigV2OnChain
witnesscalc_credentialAtomicQuerySigV2OnChain
witnesscalc_credentialAtomicQuerySigV2OnChainStatic
credentialAtomicQueryV3
witnesscalc_credentialAtomicQueryV3
witnesscalc_credentialAtomicQueryV3Static
credentialAtomicQueryV3OnChain
witnesscalc_credentialAtomicQueryV3OnChain
witnesscalc_credentialAtomicQueryV3OnChainStatic
fr
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/app
Expand All @@ -67,6 +73,8 @@ install(FILES
src/credentialAtomicQueryMTPV2.dat
src/credentialAtomicQuerySigV2OnChain.dat
src/credentialAtomicQueryMTPV2OnChain.dat
src/credentialAtomicQueryV3.dat
src/credentialAtomicQueryV3OnChain.dat
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

install(FILES
Expand All @@ -77,4 +85,6 @@ install(FILES
src/witnesscalc_credentialAtomicQueryMTPV2.h
src/witnesscalc_credentialAtomicQuerySigV2OnChain.h
src/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
src/witnesscalc_credentialAtomicQueryV3.h
src/witnesscalc_credentialAtomicQueryV3OnChain.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
36 changes: 36 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,39 @@ target_link_libraries(credentialAtomicQuerySigV2OnChain witnesscalc_credentialAt
target_compile_definitions(witnesscalc_credentialAtomicQuerySigV2OnChain PUBLIC CIRCUIT_NAME=credentialAtomicQuerySigV2OnChain)
target_compile_definitions(witnesscalc_credentialAtomicQuerySigV2OnChainStatic PUBLIC CIRCUIT_NAME=credentialAtomicQuerySigV2OnChain)
target_compile_definitions(credentialAtomicQuerySigV2OnChain PUBLIC CIRCUIT_NAME=credentialAtomicQuerySigV2OnChain)

# credentialAtomicQueryV3
set(CREDENTIALATOMICQUERYV3OFFCHAIN_SOURCES ${LIB_SOURCES}
credentialAtomicQueryV3.cpp
witnesscalc_credentialAtomicQueryV3.h
witnesscalc_credentialAtomicQueryV3.cpp
)

add_library(witnesscalc_credentialAtomicQueryV3 SHARED ${CREDENTIALATOMICQUERYV3OFFCHAIN_SOURCES})
add_library(witnesscalc_credentialAtomicQueryV3Static STATIC ${CREDENTIALATOMICQUERYV3OFFCHAIN_SOURCES})
set_target_properties(witnesscalc_credentialAtomicQueryV3Static PROPERTIES OUTPUT_NAME witnesscalc_credentialAtomicQueryV3)

add_executable(credentialAtomicQueryV3 main.cpp)
target_link_libraries(credentialAtomicQueryV3 witnesscalc_credentialAtomicQueryV3Static)

target_compile_definitions(witnesscalc_credentialAtomicQueryV3 PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3)
target_compile_definitions(witnesscalc_credentialAtomicQueryV3Static PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3)
target_compile_definitions(credentialAtomicQueryV3 PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3)

# credentialAtomicQueryV3OnChain
set(CREDENTIALATOMICQUERYV3ONCHAIN_SOURCES ${LIB_SOURCES}
credentialAtomicQueryV3OnChain.cpp
witnesscalc_credentialAtomicQueryV3OnChain.h
witnesscalc_credentialAtomicQueryV3OnChain.cpp
)

add_library(witnesscalc_credentialAtomicQueryV3OnChain SHARED ${CREDENTIALATOMICQUERYV3ONCHAIN_SOURCES})
add_library(witnesscalc_credentialAtomicQueryV3OnChainStatic STATIC ${CREDENTIALATOMICQUERYV3ONCHAIN_SOURCES})
set_target_properties(witnesscalc_credentialAtomicQueryV3OnChainStatic PROPERTIES OUTPUT_NAME witnesscalc_credentialAtomicQueryV3OnChain)

add_executable(credentialAtomicQueryV3OnChain main.cpp)
target_link_libraries(credentialAtomicQueryV3OnChain witnesscalc_credentialAtomicQueryV3OnChainStatic)

target_compile_definitions(witnesscalc_credentialAtomicQueryV3OnChain PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3OnChain)
target_compile_definitions(witnesscalc_credentialAtomicQueryV3OnChainStatic PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3OnChain)
target_compile_definitions(credentialAtomicQueryV3OnChain PUBLIC CIRCUIT_NAME=credentialAtomicQueryV3OnChain)
Loading

0 comments on commit d76edae

Please sign in to comment.