mirror of
https://github.com/logos-blockchain/logos-blockchain-pocs.git
synced 2026-01-02 13:13:09 +00:00
chore(circuits): Bundle PoQ and ZKSign (#96)
* Add PoQ bundling. * Add ZKSign bundling.
This commit is contained in:
parent
882f2c468a
commit
dfeaea6315
30
.github/resources/witness-generator/Makefile
vendored
30
.github/resources/witness-generator/Makefile
vendored
@ -1,43 +1,43 @@
|
||||
.PHONY: linux macos windows build clean
|
||||
|
||||
# ---- Arguments ----
|
||||
ifndef PROJECT
|
||||
$(error PROJECT is not set. Usage: make PROJECT=<name>. E.g.: make PROJECT=pol linux)
|
||||
endif
|
||||
|
||||
# ---- Common ----
|
||||
CXX := g++
|
||||
CXX := g++
|
||||
CXXFLAGS_COMMON := -std=c++11 -O3 -I. -Wno-address-of-packed-member
|
||||
SRCS := main.cpp calcwit.cpp fr.cpp pol.cpp
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
DEPS_HPP := circom.hpp calcwit.hpp fr.hpp
|
||||
BIN_WINDOWS := pol.exe
|
||||
BIN_UNIX := pol
|
||||
BINS := $(BIN_UNIX) $(BIN_WINDOWS)
|
||||
SRCS := main.cpp calcwit.cpp fr.cpp $(PROJECT).cpp
|
||||
OBJS := $(SRCS:.cpp=.o)
|
||||
DEPS_HPP := circom.hpp calcwit.hpp fr.hpp
|
||||
BIN := $(PROJECT)
|
||||
|
||||
# ---- Linux ----
|
||||
linux: BIN=$(BIN_UNIX)
|
||||
linux: CXXFLAGS=$(CXXFLAGS_COMMON)
|
||||
linux: LDFLAGS=-static
|
||||
linux: LDLIBS=-lgmp
|
||||
linux: $(BIN_UNIX)
|
||||
linux: $(BIN)
|
||||
|
||||
# ---- macOS ----
|
||||
macos: BIN=$(BIN_UNIX)
|
||||
macos: CXXFLAGS=$(CXXFLAGS_COMMON) -I/opt/homebrew/include -include gmp_patch.hpp
|
||||
macos: LDFLAGS=-Wl,-search_paths_first -Wl,-dead_strip
|
||||
macos: LDLIBS=/opt/homebrew/lib/libgmp.a
|
||||
macos: $(BIN_UNIX)
|
||||
macos: $(BIN)
|
||||
|
||||
# ---- Windows (MinGW) ----
|
||||
windows: BIN=$(BIN_WINDOWS)
|
||||
windows: CXXFLAGS=$(CXXFLAGS_COMMON) -I/include -Duint="unsigned int"
|
||||
windows: LDFLAGS=-static
|
||||
windows: LDLIBS=-L/lib -lgmp -lmman
|
||||
windows: $(BIN_WINDOWS)
|
||||
windows: $(BIN)
|
||||
|
||||
# ---- Rules ----
|
||||
$(BINS): $(OBJS)
|
||||
$(BIN): $(OBJS)
|
||||
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
||||
|
||||
%.o: %.cpp $(DEPS_HPP)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(BIN_WINDOWS) $(BIN_UNIX)
|
||||
rm -f $(OBJS) $(BIN)
|
||||
|
||||
|
||||
310
.github/workflows/build-circuits.yml
vendored
310
.github/workflows/build-circuits.yml
vendored
@ -12,7 +12,7 @@ on:
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Configure Environment
|
||||
name: Configure Environment
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.define-version.outputs.version }}
|
||||
@ -93,17 +93,41 @@ jobs:
|
||||
./build_gmp.sh host
|
||||
make host_linux_x86_64_static
|
||||
|
||||
- name: Generate Witness Generator's C++ Circuit
|
||||
- name: Generate PoL
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm --O2 pol.circom
|
||||
|
||||
- name: Replace Witness Generator Makefile # TODO: Make a fork generate the appropriate Linux Makefile
|
||||
- name: Replace PoL Makefile # TODO: Make a fork generate the appropriate Linux Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
- name: Compile Witness Generator
|
||||
- name: Compile PoL
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make linux
|
||||
run: make PROJECT=pol linux
|
||||
|
||||
- name: Generate PoQ
|
||||
working-directory: repo/circom_circuits/Blend
|
||||
run: circom --c --r1cs --no_asm --O2 poq.circom
|
||||
|
||||
- name: Replace PoQ Makefile # TODO: Make a fork generate the appropriate Linux Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile
|
||||
|
||||
- name: Compile PoQ
|
||||
working-directory: repo/circom_circuits/Blend/poq_cpp
|
||||
run: make PROJECT=poq linux
|
||||
|
||||
- name: Generate ZKSign
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm --O2 signature.circom
|
||||
|
||||
- name: Replace ZKSign Makefile # TODO: Make a fork generate the appropriate Linux Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile
|
||||
|
||||
- name: Compile ZKSign
|
||||
working-directory: repo/circom_circuits/Mantle/signature_cpp
|
||||
run: make PROJECT=signature linux
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
working-directory: repo
|
||||
@ -133,37 +157,85 @@ jobs:
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle Pol Witness Generator
|
||||
- name: Bundle PoL Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: pol
|
||||
PLATFORM_BINARY_NAME: pol
|
||||
BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}"/{pol,pol.dat} "$BUNDLE_DIR/"
|
||||
|
||||
|
||||
ls -la ${WITNESS_GENERATOR_DIR}
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle PoQ Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: poq
|
||||
PLATFORM_BINARY_NAME: poq
|
||||
BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle ZKSign Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: signature
|
||||
PLATFORM_BINARY_NAME: zksign
|
||||
BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Upload Rapidsnark Prover
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Rapidsnark Verifier
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Pol Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
- name: Upload PoL Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload PoQ Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload ZKSign Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
build-windows:
|
||||
name: Build Windows Binaries (Native)
|
||||
runs-on: windows-latest
|
||||
@ -235,7 +307,7 @@ jobs:
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
run: cp .github/resources/prover/${{ env.OS }}.src-CMakeLists.txt circom_circuits/rapidsnark/src/CMakeLists.txt
|
||||
|
||||
|
||||
- name: Patch Windows mman
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
@ -258,19 +330,47 @@ jobs:
|
||||
./build_gmp.sh host
|
||||
make host_windows_x86_64_static
|
||||
|
||||
- name: Generate Witness Generator's C++ Circuit
|
||||
- name: Generate PoL
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm pol.circom
|
||||
|
||||
- name: Replace Witness Generator Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
||||
- name: Replace PoL Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
- name: Compile Witness Generator
|
||||
- name: Compile PoL
|
||||
shell: msys2 {0}
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make windows
|
||||
run: make PROJECT=pol windows
|
||||
|
||||
- name: Generate PoQ
|
||||
working-directory: repo/circom_circuits/Blend
|
||||
run: circom --c --r1cs --no_asm poq.circom
|
||||
|
||||
- name: Replace PoQ Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile
|
||||
|
||||
- name: Compile PoQ
|
||||
shell: msys2 {0}
|
||||
working-directory: repo/circom_circuits/Blend/poq_cpp
|
||||
run: make PROJECT=poq windows
|
||||
|
||||
- name: Generate ZKSign
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm signature.circom
|
||||
|
||||
- name: Replace ZKSign Makefile # TODO: Make a fork generate the appropriate Windows Makefile
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile
|
||||
|
||||
- name: Compile ZKSign
|
||||
shell: msys2 {0}
|
||||
working-directory: repo/circom_circuits/Mantle/signature_cpp
|
||||
run: make PROJECT=signature windows
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
shell: msys2 {0}
|
||||
@ -302,39 +402,87 @@ jobs:
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle Pol Witness Generator
|
||||
- name: Bundle PoL Witness Generator
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: pol
|
||||
PLATFORM_BINARY_NAME: pol.exe
|
||||
BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/pol" "$BUNDLE_DIR/pol.exe"
|
||||
mv "${WITNESS_GENERATOR_DIR}/pol.dat" "$BUNDLE_DIR/pol.exe.dat"
|
||||
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle PoQ Witness Generator
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: poq
|
||||
PLATFORM_BINARY_NAME: poq.exe
|
||||
BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle ZKSign Witness Generator
|
||||
shell: msys2 {0}
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: signature
|
||||
PLATFORM_BINARY_NAME: zksign.exe
|
||||
BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Upload Rapidsnark Prover
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Rapidsnark Verifier
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Pol Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
- name: Upload PoL Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload PoQ Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload ZKSign Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
build-macos:
|
||||
name: Build MacOS Binaries (Native)
|
||||
runs-on: macos-latest
|
||||
@ -383,11 +531,11 @@ jobs:
|
||||
./build_gmp.sh macos_arm64
|
||||
make macos_arm64
|
||||
|
||||
- name: Generate Witness Generator's C++ Circuit
|
||||
- name: Generate PoL
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm --O2 pol.circom
|
||||
|
||||
- name: Replace Witness Generator's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile
|
||||
- name: Replace PoL's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/pol_cpp/Makefile
|
||||
|
||||
@ -395,9 +543,41 @@ jobs:
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Mantle/pol_cpp/gmp_patch.hpp
|
||||
|
||||
- name: Compile Witness Generator
|
||||
- name: Compile PoL
|
||||
working-directory: repo/circom_circuits/Mantle/pol_cpp
|
||||
run: make macos
|
||||
run: make PROJECT=pol macos
|
||||
|
||||
- name: Generate PoQ
|
||||
working-directory: repo/circom_circuits/Blend
|
||||
run: circom --c --r1cs --no_asm --O2 poq.circom
|
||||
|
||||
- name: Replace PoQ's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Blend/poq_cpp/Makefile
|
||||
|
||||
- name: Patch MacOS GMP
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Blend/poq_cpp/gmp_patch.hpp
|
||||
|
||||
- name: Compile PoQ
|
||||
working-directory: repo/circom_circuits/Blend/poq_cpp
|
||||
run: make PROJECT=poq macos
|
||||
|
||||
- name: Generate ZKSign
|
||||
working-directory: repo/circom_circuits/Mantle
|
||||
run: circom --c --r1cs --no_asm --O2 signature.circom
|
||||
|
||||
- name: Replace ZKSign's Makefile # TODO: Make a fork generate the appropriate MacOS Makefile
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/Makefile circom_circuits/Mantle/signature_cpp/Makefile
|
||||
|
||||
- name: Patch MacOS GMP
|
||||
working-directory: repo
|
||||
run: cp .github/resources/witness-generator/${{ env.OS }}.gmp_patch.hpp circom_circuits/Mantle/signature_cpp/gmp_patch.hpp
|
||||
|
||||
- name: Compile ZKSign
|
||||
working-directory: repo/circom_circuits/Mantle/signature_cpp
|
||||
run: make PROJECT=signature macos
|
||||
|
||||
- name: Bundle Rapidsnark Prover
|
||||
working-directory: repo
|
||||
@ -427,37 +607,85 @@ jobs:
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle Pol Witness Generator
|
||||
- name: Bundle PoL Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: pol
|
||||
PLATFORM_BINARY_NAME: pol
|
||||
BUNDLE_NAME: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/pol_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}"/{pol,pol.dat} "$BUNDLE_DIR/"
|
||||
|
||||
|
||||
ls -la ${WITNESS_GENERATOR_DIR}
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle PoQ Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: poq
|
||||
PLATFORM_BINARY_NAME: poq
|
||||
BUNDLE_NAME: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Blend/poq_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Bundle ZKSign Witness Generator
|
||||
working-directory: repo
|
||||
env:
|
||||
CIRCUIT_NAME: signature
|
||||
PLATFORM_BINARY_NAME: zksign
|
||||
BUNDLE_NAME: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}
|
||||
WITNESS_GENERATOR_DIR: circom_circuits/Mantle/signature_cpp
|
||||
run: |
|
||||
BUNDLE_DIR="${BUNDLE_NAME}/witness-generator"
|
||||
mkdir -p "$BUNDLE_DIR"
|
||||
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}"
|
||||
mv "${WITNESS_GENERATOR_DIR}/${CIRCUIT_NAME}.dat" "$BUNDLE_DIR/${PLATFORM_BINARY_NAME}.dat"
|
||||
|
||||
tar -czf "${BUNDLE_NAME}.tar.gz" "${BUNDLE_NAME}"
|
||||
|
||||
- name: Upload Rapidsnark Prover
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/prover-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Rapidsnark Verifier
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/verifier-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload Pol Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
- name: Upload PoL Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/pol-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload PoQ Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/poq-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
- name: Upload ZKSign Witness Generator
|
||||
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8
|
||||
with:
|
||||
name: zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
path: repo/zksign-${{ env.VERSION }}-${{ env.OS }}-${{ env.ARCH }}.tar.gz
|
||||
|
||||
publish-release:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
@ -499,7 +727,7 @@ jobs:
|
||||
upload-artifacts:
|
||||
name: Upload Artifacts to Release
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
needs:
|
||||
- setup
|
||||
- publish-release
|
||||
strategy:
|
||||
@ -516,6 +744,8 @@ jobs:
|
||||
- prover
|
||||
- verifier
|
||||
- pol
|
||||
- poq
|
||||
- zksign
|
||||
env:
|
||||
UPLOAD_URL: ${{ needs.publish-release.outputs.upload_url }}
|
||||
ARTIFACT_NAME: ${{ matrix.artifact }}-${{ needs.setup.outputs.version }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.tar.gz
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user