Skip to content

Commit

Permalink
Merge pull request #24 from 0xPolygonID/feature/linkedMultiQuery10
Browse files Browse the repository at this point in the history
LinkedMultiQuery10
  • Loading branch information
demonsh authored Apr 9, 2024
2 parents 1863c60 + 6316c35 commit cd66e11
Show file tree
Hide file tree
Showing 9 changed files with 950,458 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ add_subdirectory(src)
install(TARGETS
tests
test_platform
#auth
#witnesscalc_auth
#witnesscalc_authStatic
authV2
witnesscalc_authV2
witnesscalc_authV2Static
Expand All @@ -58,6 +55,9 @@ install(TARGETS
credentialAtomicQueryV3OnChain
witnesscalc_credentialAtomicQueryV3OnChain
witnesscalc_credentialAtomicQueryV3OnChainStatic
linkedMultiQuery10
witnesscalc_linkedMultiQuery10
witnesscalc_linkedMultiQuery10Static
fr
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/app
Expand All @@ -67,24 +67,24 @@ install(FILES "${GMP_LIB_DIR}/${GMP_LIB_FILE}"
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

install(FILES
# src/auth.dat
src/authV2.dat
src/credentialAtomicQuerySigV2.dat
src/credentialAtomicQueryMTPV2.dat
src/credentialAtomicQuerySigV2OnChain.dat
src/credentialAtomicQueryMTPV2OnChain.dat
src/credentialAtomicQueryV3.dat
src/credentialAtomicQueryV3OnChain.dat
src/linkedMultiQuery10.dat
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)

install(FILES
src/witnesscalc.h
#src/witnesscalc_auth.h
src/witnesscalc_authV2.h
src/witnesscalc_credentialAtomicQuerySigV2.h
src/witnesscalc_credentialAtomicQueryMTPV2.h
src/witnesscalc_credentialAtomicQuerySigV2OnChain.h
src/witnesscalc_credentialAtomicQueryMTPV2OnChain.h
src/witnesscalc_credentialAtomicQueryV3.h
src/witnesscalc_credentialAtomicQueryV3OnChain.h
src/witnesscalc_linkedMultiQuery10.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
13 changes: 13 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,16 @@ snarkjs groth16 verify \
circuits/credentialAtomicQueryV3OnChain-beta.1/verification_key.json \
temp/credentialAtomicQueryV3OnChain_MTP_public.json \
temp/credentialAtomicQueryV3OnChain_MTP_proof.json

package/bin/linkedMultiQuery10 \
testdata/linkedMultiQuery10_input.json \
temp/linkedMultiQuery10_witness.wtns
snarkjs groth16 prove \
circuits/linkedMultiQuery10-beta.1/circuit_final.zkey \
temp/linkedMultiQuery10_witness.wtns \
temp/linkedMultiQuery10_proof.json \
temp/linkedMultiQuery10_public.json
snarkjs groth16 verify \
circuits/linkedMultiQuery10-beta.1/verification_key.json \
temp/linkedMultiQuery10_public.json \
temp/linkedMultiQuery10_proof.json
20 changes: 20 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,23 @@ target_link_libraries(credentialAtomicQueryV3OnChain witnesscalc_credentialAtomi
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)

# linkedMultiQuery10
# authV2
set(LINKEDMULTIQUERY10_SOURCES ${LIB_SOURCES}
linkedMultiQuery10.cpp
witnesscalc_linkedMultiQuery10.h
witnesscalc_linkedMultiQuery10.cpp
)

add_library(witnesscalc_linkedMultiQuery10 SHARED ${LINKEDMULTIQUERY10_SOURCES})
add_library(witnesscalc_linkedMultiQuery10Static STATIC ${LINKEDMULTIQUERY10_SOURCES})
set_target_properties(witnesscalc_linkedMultiQuery10Static PROPERTIES OUTPUT_NAME witnesscalc_linkedMultiQuery10)

add_executable(linkedMultiQuery10 main.cpp)
target_link_libraries(linkedMultiQuery10 witnesscalc_linkedMultiQuery10Static)

target_compile_definitions(witnesscalc_linkedMultiQuery10 PUBLIC CIRCUIT_NAME=linkedMultiQuery10)
target_compile_definitions(witnesscalc_linkedMultiQuery10Static PUBLIC CIRCUIT_NAME=linkedMultiQuery10)
target_compile_definitions(linkedMultiQuery10 PUBLIC CIRCUIT_NAME=linkedMultiQuery10)

949,251 changes: 949,251 additions & 0 deletions src/linkedMultiQuery10.cpp

Large diffs are not rendered by default.

Binary file added src/linkedMultiQuery10.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void writeBinWitness(char *witnessBuffer, unsigned long witnessSize, std::string
fclose(write_ptr);
}

static const size_t WitnessBufferSize = 4*1024*1024;
static const size_t WitnessBufferSize = 8*1024*1024;
static char WitnessBuffer[WitnessBufferSize];

int main (int argc, char *argv[]) {
Expand Down
15 changes: 15 additions & 0 deletions src/witnesscalc_linkedMultiQuery10.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "witnesscalc_linkedMultiQuery10.h"
#include "witnesscalc.h"

int
witnesscalc_linkedMultiQuery10(
const char *circuit_buffer, unsigned long circuit_size,
const char *json_buffer, unsigned long json_size,
char *wtns_buffer, unsigned long *wtns_size,
char *error_msg, unsigned long error_msg_maxsize)
{
return CIRCUIT_NAME::witnesscalc(circuit_buffer, circuit_size,
json_buffer, json_size,
wtns_buffer, wtns_size,
error_msg, error_msg_maxsize);
}
39 changes: 39 additions & 0 deletions src/witnesscalc_linkedMultiQuery10.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef WITNESSCALC_LINKEDMULTIQUERY10_H
#define WITNESSCALC_LINKEDMULTIQUERY10_H


#ifdef __cplusplus
extern "C" {
#endif

#define WITNESSCALC_OK 0x0
#define WITNESSCALC_ERROR 0x1
#define WITNESSCALC_ERROR_SHORT_BUFFER 0x2

/**
*
* @return error code:
* WITNESSCALC_OK - in case of success.
* WITNESSCALC_ERROR - in case of an error.
*
* On success wtns_buffer is filled with witness data and
* wtns_size contains the number bytes copied to wtns_buffer.
*
* If wtns_buffer is too small then the function returns WITNESSCALC_ERROR_SHORT_BUFFER
* and the minimum size for wtns_buffer in wtns_size.
*
*/

int
witnesscalc_linkedMultiQuery10(
const char *circuit_buffer, unsigned long circuit_size,
const char *json_buffer, unsigned long json_size,
char *wtns_buffer, unsigned long *wtns_size,
char *error_msg, unsigned long error_msg_maxsize);

#ifdef __cplusplus
}
#endif


#endif // WITNESSCALC_LINKEDMULTIQUERY10_H
Loading

0 comments on commit cd66e11

Please sign in to comment.