Files
self/app/scripts/common.sh
0xturboblitz 7b213f71f3 Integrate new two-step process and proving in mobile app
- still need to solve https call to merkle tree server
- not tested on android
2024-05-16 17:26:36 +09:00

36 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
cp ../circuits/build/register_sha256WithRSAEncryption_65537_cpp/register_sha256WithRSAEncryption_65537.cpp witnesscalc/src
cp ../circuits/build/register_sha256WithRSAEncryption_65537_cpp/register_sha256WithRSAEncryption_65537.dat witnesscalc/src
cp ../circuits/build/disclose_cpp/disclose.cpp witnesscalc/src
cp ../circuits/build/disclose_cpp/disclose.dat witnesscalc/src
cd witnesscalc/src
# This adds the namespace to the circuit file as described in the README
last_include=$(grep -n '#include' register_sha256WithRSAEncryption_65537.cpp | tail -1 | cut -d: -f1)
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS requires an empty string with the -i flag and handles backslashes differently
sed -i "" "${last_include}a\\
namespace CIRCUIT_NAME {" register_sha256WithRSAEncryption_65537.cpp
else
# Linux
sed -i "${last_include}a \\nnamespace CIRCUIT_NAME {" register_sha256WithRSAEncryption_65537.cpp
fi
echo "}" >> register_sha256WithRSAEncryption_65537.cpp
# This adds the namespace to the circuit file as described in the README
last_include=$(grep -n '#include' disclose.cpp | tail -1 | cut -d: -f1)
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS requires an empty string with the -i flag and handles backslashes differently
sed -i "" "${last_include}a\\
namespace CIRCUIT_NAME {" disclose.cpp
else
# Linux
sed -i "${last_include}a \\nnamespace CIRCUIT_NAME {" disclose.cpp
fi
echo "}" >> disclose.cpp
cd ../..
git submodule init
git submodule update