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

Exceptions + circuits v3 #14

Merged
merged 16 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ typings/
.next

tmp
temp

.DS_Store

Expand Down
4 changes: 2 additions & 2 deletions build/fr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include <assert.h>
#include <string>
#include <stdexcept>


static mpz_t q;
Expand Down Expand Up @@ -162,7 +162,7 @@ void Fr_div(PFrElement r, PFrElement a, PFrElement b) {
}

void Fr_fail() {
assert(false);
throw std::runtime_error("Fr error");
}

void Fr_longErr()
Expand Down
1 change: 0 additions & 1 deletion build/fr_generic.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "fr.hpp"
#include <cstdint>
#include <cstring>
#include <cassert>

FrElement Fr_q = {0, 0x80000000, {0x43e1f593f0000001,0x2833e84879b97091,0xb85045b68181585d,0x30644e72e131a029}};
FrElement Fr_R2 = {0, 0x80000000, {0x1bb8e645ae216da7,0x53fe3ab1e35c59e3,0x8c49833d53bb8085,0x0216d0b17f4e44a5}};
Expand Down
2 changes: 1 addition & 1 deletion depends/json
Submodule json updated 286 files
74 changes: 38 additions & 36 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
set -e
set -x

mkdir -p temp

package/bin/authV2 \
testdata/authV2_input.json \
temp/authV2_witness.wtns
Expand Down Expand Up @@ -71,51 +73,51 @@ snarkjs groth16 verify \
package/bin/credentialAtomicQueryV3 \
testdata/credentialAtomicQueryV3_Sig_input.json \
temp/credentialAtomicQueryV3_Sig_witness.wtns
snarkjs groth16 prove \
circuits/credentialAtomicQueryV3/circuit_final.zkey \
temp/credentialAtomicQueryV3_Sig_witness.wtns \
temp/credentialAtomicQueryV3_Sig_proof.json \
temp/credentialAtomicQueryV3_Sig_public.json
snarkjs groth16 verify \
circuits/credentialAtomicQueryV3/verification_key.json \
temp/credentialAtomicQueryV3_Sig_public.json \
temp/credentialAtomicQueryV3_Sig_proof.json
#snarkjs groth16 prove \
# circuits/credentialAtomicQueryV3/circuit_final.zkey \
# temp/credentialAtomicQueryV3_Sig_witness.wtns \
# temp/credentialAtomicQueryV3_Sig_proof.json \
# temp/credentialAtomicQueryV3_Sig_public.json
#snarkjs groth16 verify \
# circuits/credentialAtomicQueryV3/verification_key.json \
# temp/credentialAtomicQueryV3_Sig_public.json \
# temp/credentialAtomicQueryV3_Sig_proof.json
OBrezhniev marked this conversation as resolved.
Show resolved Hide resolved

package/bin/credentialAtomicQueryV3 \
testdata/credentialAtomicQueryV3_MTP_input.json \
temp/credentialAtomicQueryV3_MTP_witness.wtns
snarkjs groth16 prove \
circuits/credentialAtomicQueryV3/circuit_final.zkey \
temp/credentialAtomicQueryV3_MTP_witness.wtns \
temp/credentialAtomicQueryV3_MTP_proof.json \
temp/credentialAtomicQueryV3_MTP_public.json
snarkjs groth16 verify \
circuits/credentialAtomicQueryV3/verification_key.json \
temp/credentialAtomicQueryV3_MTP_public.json \
temp/credentialAtomicQueryV3_MTP_proof.json
#snarkjs groth16 prove \
# circuits/credentialAtomicQueryV3/circuit_final.zkey \
# temp/credentialAtomicQueryV3_MTP_witness.wtns \
# temp/credentialAtomicQueryV3_MTP_proof.json \
# temp/credentialAtomicQueryV3_MTP_public.json
#snarkjs groth16 verify \
# circuits/credentialAtomicQueryV3/verification_key.json \
# temp/credentialAtomicQueryV3_MTP_public.json \
# temp/credentialAtomicQueryV3_MTP_proof.json

package/bin/credentialAtomicQueryV3OnChain \
testdata/credentialAtomicQueryV3OnChain_Sig_input.json \
temp/credentialAtomicQueryV3OnChain_Sig_witness.wtns
snarkjs groth16 prove \
circuits/credentialAtomicQueryV3OnChain/circuit_final.zkey \
temp/credentialAtomicQueryV3OnChain_Sig_witness.wtns \
temp/credentialAtomicQueryV3OnChain_Sig_proof.json \
temp/credentialAtomicQueryV3OnChain_Sig_public.json
snarkjs groth16 verify \
circuits/credentialAtomicQueryV3OnChain/verification_key.json \
temp/credentialAtomicQueryV3OnChain_Sig_public.json \
temp/credentialAtomicQueryV3OnChain_Sig_proof.json
#snarkjs groth16 prove \
# circuits/credentialAtomicQueryV3OnChain/circuit_final.zkey \
# temp/credentialAtomicQueryV3OnChain_Sig_witness.wtns \
# temp/credentialAtomicQueryV3OnChain_Sig_proof.json \
# temp/credentialAtomicQueryV3OnChain_Sig_public.json
#snarkjs groth16 verify \
# circuits/credentialAtomicQueryV3OnChain/verification_key.json \
# temp/credentialAtomicQueryV3OnChain_Sig_public.json \
# temp/credentialAtomicQueryV3OnChain_Sig_proof.json

package/bin/credentialAtomicQueryV3OnChain \
testdata/credentialAtomicQueryV3OnChain_MTP_input.json \
temp/credentialAtomicQueryV3OnChain_MTP_witness.wtns
snarkjs groth16 prove \
circuits/credentialAtomicQueryV3OnChain/circuit_final.zkey \
temp/credentialAtomicQueryV3OnChain_MTP_witness.wtns \
temp/credentialAtomicQueryV3OnChain_MTP_proof.json \
temp/credentialAtomicQueryV3OnChain_MTP_public.json
snarkjs groth16 verify \
circuits/credentialAtomicQueryV3OnChain/verification_key.json \
temp/credentialAtomicQueryV3OnChain_MTP_public.json \
temp/credentialAtomicQueryV3OnChain_MTP_proof.json
#snarkjs groth16 prove \
# circuits/credentialAtomicQueryV3OnChain/circuit_final.zkey \
# temp/credentialAtomicQueryV3OnChain_MTP_witness.wtns \
# temp/credentialAtomicQueryV3OnChain_MTP_proof.json \
# temp/credentialAtomicQueryV3OnChain_MTP_public.json
#snarkjs groth16 verify \
# circuits/credentialAtomicQueryV3OnChain/verification_key.json \
# temp/credentialAtomicQueryV3OnChain_MTP_public.json \
# temp/credentialAtomicQueryV3OnChain_MTP_proof.json
18 changes: 0 additions & 18 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,6 @@ set(LIB_SOURCES
witnesscalc.cpp
)

# # auth
# set(AUTH_SOURCES ${LIB_SOURCES}
# auth.cpp
# witnesscalc_auth.h
# witnesscalc_auth.cpp
# )
#
# add_library(witnesscalc_auth SHARED ${AUTH_SOURCES})
# add_library(witnesscalc_authStatic STATIC ${AUTH_SOURCES})
# set_target_properties(witnesscalc_authStatic PROPERTIES OUTPUT_NAME witnesscalc_auth)
#
# add_executable(auth main.cpp)
# target_link_libraries(auth witnesscalc_authStatic)
#
# target_compile_definitions(witnesscalc_auth PUBLIC CIRCUIT_NAME=auth)
# target_compile_definitions(witnesscalc_authStatic PUBLIC CIRCUIT_NAME=auth)
# target_compile_definitions(auth PUBLIC CIRCUIT_NAME=auth)

# authV2
set(AUTHV2_SOURCES ${LIB_SOURCES}
authV2.cpp
Expand Down
Loading