Skip to content

Commit

Permalink
Add verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nixw committed Feb 5, 2024
1 parent 5af1b04 commit fdb82bc
Show file tree
Hide file tree
Showing 10 changed files with 748 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ endif()
add_subdirectory(src)


install(TARGETS prover rapidsnark rapidsnarkStatic rapidsnarkStaticFrFq test_prover fr fq
install(TARGETS prover verifier rapidsnark rapidsnarkStatic rapidsnarkStaticFrFq test_prover fr fq
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/app
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

install(FILES "${GMP_LIB_DIR}/${GMP_LIB_FILE}"
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

install(FILES src/prover.h
install(FILES src/prover.h src/verifier.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
2 changes: 1 addition & 1 deletion depends/ffiasm
2 changes: 1 addition & 1 deletion depends/pistache
Submodule pistache updated 251 files
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ set(LIB_SOURCES
fileloader.hpp
prover.cpp
prover.h
verifier.cpp
verifier.h
../depends/ffiasm/c/misc.cpp
../depends/ffiasm/c/naf.cpp
../depends/ffiasm/c/splitparstr.cpp
Expand Down Expand Up @@ -115,10 +117,14 @@ set_target_properties(rapidsnarkStaticFrFq PROPERTIES OUTPUT_NAME rapidsnark-fr-
add_executable(prover main_prover.cpp)
target_link_libraries(prover rapidsnarkStatic)

add_executable(verifier main_verifier.cpp)
target_link_libraries(verifier rapidsnarkStatic)

add_library(rapidsnark SHARED ${LIB_SOURCES})

if(USE_LOGGER OR NOT USE_OPENMP)
target_link_libraries(prover pthread)
target_link_libraries(verifier pthread)
endif()

if(USE_SODIUM)
Expand All @@ -130,10 +136,12 @@ if(OpenMP_CXX_FOUND)

if(TARGET_PLATFORM MATCHES "android")
target_link_libraries(prover -static-openmp -fopenmp)
target_link_libraries(verifier -static-openmp -fopenmp)
target_link_libraries(rapidsnark -static-openmp -fopenmp)

elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(prover OpenMP::OpenMP_CXX)
target_link_libraries(verifier OpenMP::OpenMP_CXX)
endif()

endif()
Expand Down
2 changes: 2 additions & 0 deletions src/fileloader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class FileLoader
void* dataBuffer() { return addr; }
size_t dataSize() const { return size; }

std::string dataAsString() { return std::string((char*)addr, size); }

private:
void* addr;
size_t size;
Expand Down
Loading

0 comments on commit fdb82bc

Please sign in to comment.