diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..9dc6757 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,97 @@ +name: Pull Request + +on: + pull_request: + branches: + - '**' + +jobs: + job: + name: ${{ github.workflow }}:${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 1 + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest] + include: + - os: ubuntu-latest + vcpkgCommitId: '834977918592e4f5d5ec5fe48ba338c608faf9f9' + cmakeGen: '"Unix Makefiles"' + cc: gcc + cxx: g++ + tools: echo "skip openmp installation" + platform: linux + + - os: macos-latest + vcpkgCommitId: '834977918592e4f5d5ec5fe48ba338c608faf9f9' + cmakeGen: '"Unix Makefiles"' + cc: clang + cxx: clang++ + lgflags: -L/opt/homebrew/opt/libomp/lib + cxxflags: -I/opt/homebrew/opt/libomp/include + tools: NONINTERACTIVE=1 brew install libomp + platform: darwin + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: lukka/get-cmake@latest + - name: Dump the content of $RUNNER_TEMP + run: find $RUNNER_TEMP + shell: bash + - name: Dump the content of $RUNNER_WORKSPACE + run: find $RUNNER_WORKSPACE + shell: bash + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11 + id: runvcpkg + with: + # This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch. + vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' + # The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule. + vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}' + # The vcpkg.json file, which will be part of cache key computation. + vcpkgJsonGlob: '**/vcpkg.json' + + - name: install tools + run: ${{ matrix.tools }} + + - name: Prints output of run-vcpkg's action + run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'" + + - name: Build Info + run: ${{ matrix.cxx }} --version && cmake --version + + - name: Release Build - Run CMake with vcpkg.json manifest + env: + VCPKG_ROOT: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }} + BUILD_TYPE: Release + BIN_DIR: rel + LDFLAGS: ${{matrix.ldflags}} + CPPFLAGS: ${{matrix.cxxflags}} + OpenMP_ROOT: /opt/homebrew/opt/libomp + run: cmake -DCMAKE_CXX_COMPILER=${{matrix.cxx}} -G ${{matrix.cmakeGen}} --preset=base + shell: bash + + - name: Release Build - Run build + run: cmake --build .build/rel + shell: bash + + - name: Debug Build - Run CMake with vcpkg.json manifest + env: + VCPKG_ROOT: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }} + BUILD_TYPE: Debug + BIN_DIR: deb + LDFLAGS: ${{matrix.ldflags}} + CPPFLAGS: ${{matrix.cxxflags}} + OpenMP_ROOT: /opt/homebrew/opt/libomp + run: cmake -DCMAKE_CXX_COMPILER=${{matrix.cxx}} -G ${{matrix.cmakeGen}} --preset=base + shell: bash + + - name: Debug Build - Run build + run: cmake --build .build/deb + shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a11ce98 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,93 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: + - '*' + +jobs: + job: + name: ${{ github.workflow }}:${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 1 + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest] + include: + - os: ubuntu-latest + vcpkgCommitId: '834977918592e4f5d5ec5fe48ba338c608faf9f9' + cmakeGen: '"Unix Makefiles"' + cc: gcc + cxx: g++ + tools: echo "skip openmp installation" + platform: linux + + - os: macos-latest + vcpkgCommitId: '834977918592e4f5d5ec5fe48ba338c608faf9f9' + cmakeGen: '"Unix Makefiles"' + cc: clang + cxx: clang++ + lgflags: -L/opt/homebrew/opt/libomp/lib + cxxflags: -I/opt/homebrew/opt/libomp/include + tools: NONINTERACTIVE=1 brew install libomp + platform: darwin + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: lukka/get-cmake@latest + - name: Dump the content of $RUNNER_TEMP + run: find $RUNNER_TEMP + shell: bash + - name: Dump the content of $RUNNER_WORKSPACE + run: find $RUNNER_WORKSPACE + shell: bash + + - name: Setup vcpkg + uses: lukka/run-vcpkg@v11 + id: runvcpkg + with: + # This specifies the location of vcpkg, where it is going to be restored from cache, or create from scratch. + vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' + # The Git commit id of vcpkg to be checked out. This is only needed because we are not using a submodule. + vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}' + # The vcpkg.json file, which will be part of cache key computation. + vcpkgJsonGlob: '**/vcpkg.json' + + - name: install tools + run: ${{ matrix.tools }} + + - name: Prints output of run-vcpkg's action + run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}'" + + - name: Build Info + run: ${{ matrix.cxx }} --version && cmake --version + + - name: Run CMake with vcpkg.json manifest + env: + VCPKG_ROOT: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }} + BUILD_TYPE: Release + BIN_DIR: rel + LDFLAGS: ${{matrix.ldflags}} + CPPFLAGS: ${{matrix.cxxflags}} + OpenMP_ROOT: /opt/homebrew/opt/libomp + run: cmake -DCMAKE_CXX_COMPILER=${{matrix.cxx}} -G ${{matrix.cmakeGen}} --preset=base + shell: bash + + - name: Run build + run: cmake --build .build/rel + shell: bash + + - name: Run install + run: cmake --install .build/rel + shell: bash + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: fairmath-keygen-${{matrix.platform}} + path: .build/install diff --git a/.gitignore b/.gitignore index 89620f3..dbee9c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ BUILD +.build +CMakeUserPresets.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index adb37d1..88190eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,16 @@ cmake_minimum_required(VERSION 3.22) -project(fairmathCli CXX) +project(fairmath-keygen CXX) + set(CMAKE_CXX_STANDARD 20) +set(CMAKE_SKIP_BUILD_RPATH FALSE) +set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +set(CMAKE_INSTALL_RPATH "\${ORIGIN}/lib") +find_package(OpenMP) +find_package(Boost REQUIRED COMPONENTS program_options) find_package(OpenFHE CONFIG REQUIRED) +find_path(NLOHMANN_JSON_INCLUDE_DIRS "nlohmann/adl_serializer.hpp") if (OpenFHE_FOUND) message(STATUS "FOUND PACKAGE OpenFHE") @@ -16,23 +23,33 @@ else() message(FATAL_ERROR "PACKAGE OpenFHE NOT FOUND") endif() -set(CMAKE_CXX_FLAGS ${OpenFHE_CXX_FLAGS}) +include_directories( + ${OpenFHE_INCLUDE} + ${OpenFHE_INCLUDE}/core + ${OpenFHE_INCLUDE}/pke + ${OpenFHE_INCLUDE}/binfhe + ${NLOHMANN_JSON_INCLUDE_DIRS} +) -include_directories(${OPENMP_INCLUDES}) -include_directories(${OpenFHE_INCLUDE}) -include_directories(${OpenFHE_INCLUDE}/third-party/include) -include_directories(${OpenFHE_INCLUDE}/core) -include_directories(${OpenFHE_INCLUDE}/pke) -include_directories(${OpenFHE_INCLUDE}/binfhe) +set(SOURCES + src/fairmathCli.cpp +) -link_directories(${OpenFHE_LIBDIR}) -link_directories(${OPENMP_LIBRARIES}) +add_executable(fairmath-keygen ${SOURCES}) -set(CMAKE_EXE_LINKER_FLAGS ${OpenFHE_EXE_LINKER_FLAGS}) -link_libraries(${OpenFHE_SHARED_LIBRARIES}) +if (OpenMP_CXX_FOUND) + message(STATUS "FOUND OpenMP: ${OpenMP_CXX_LIBRARIES}") + message(STATUS "FOUND OpenMP Dir: ${OpenMP_libomp_LIBRARY}") -find_package(Boost REQUIRED COMPONENTS program_options) -add_executable(fairmathCli fairmathCli.cpp) + #workaround for macos github actions + set(lib_openmp_path "${OpenMP_libomp_LIBRARY}") + cmake_path(GET lib_openmp_path PARENT_PATH OMP_LINK_DIR) + + target_link_directories(fairmath-keygen PRIVATE ${OMP_LINK_DIR}) +endif() -target_link_libraries(fairmathCli -ltcmalloc_minimal -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free ${Boost_PROGRAM_OPTIONS_LIBRARY}) +target_include_directories(fairmath-keygen PRIVATE ${NLOHMANN_JSON_INCLUDE_DIRS}) +target_link_libraries(fairmath-keygen PRIVATE ${OpenFHE_SHARED_LIBRARIES} Boost::program_options) +install(TARGETS fairmath-keygen DESTINATION install) +install(DIRECTORY ${OpenFHE_LIBDIR} DESTINATION install) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..8f64e16 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "configurePresets": [ + { + "name": "base", + "displayName": "Unix Makefiles", + "generator": "Unix Makefiles", + "binaryDir": "${sourceDir}/.build/$env{BIN_DIR}", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "CMAKE_BUILD_TYPE": "$env{BUILD_TYPE}", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/.build" + } + } + ] + } \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100755 index d66b9b2..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -rm -rf BUILD -mkdir BUILD && cd BUILD -cmake -DCMAKE_BUILD_TYPE=Release .. -cmake --build . -cd ../ diff --git a/data/output/ciphertext_1 b/data/output/ciphertext_1 deleted file mode 100644 index 7e295a3..0000000 Binary files a/data/output/ciphertext_1 and /dev/null differ diff --git a/data/output/ciphertext_2 b/data/output/ciphertext_2 deleted file mode 100644 index 368386d..0000000 Binary files a/data/output/ciphertext_2 and /dev/null differ diff --git a/data/output/config.json b/data/output/config.json deleted file mode 100644 index d7867b2..0000000 --- a/data/output/config.json +++ /dev/null @@ -1 +0,0 @@ -{"ciphertext_1":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name","public_key_name"],"plaintext_value":[1],"public_key":"public_key_name","source":"local:///root/GIT/fairmath-cli/data/output/ciphertext_1","type":"ciphertext"},"ciphertext_2":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name","public_key_name"],"plaintext_value":[1,2,3,-4],"public_key":"public_key_name","source":"local:///root/GIT/fairmath-cli/data/output/ciphertext_2","type":"ciphertext"},"cryptocontext_name":{"scheme":"CKKSRNS_SCHEME","source":"local:///root/GIT/fairmath-cli/data/output/cryptocontext_name","type":"cryptocontext"},"mult_key_name":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name","private_key_name"],"private_key":"private_key_name","source":"local:///root/GIT/fairmath-cli/data/output/mult_key_name","type":"mult_key"},"non_encrypted_data_1":{"type":"i32","value":46},"non_encrypted_data_2":{"type":"i32","value":[1,2,3,4]},"private_key_name":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name"],"linked_key_for_generation":"public_key_name","source":"local:///root/GIT/fairmath-cli/data/output/private_key_name","type":"private_key"},"public_key_name":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name"],"linked_key_for_generation":"private_key_name","source":"local:///root/GIT/fairmath-cli/data/output/public_key_name","type":"public_key"},"rotation_key_name":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name","private_key_name"],"indexes":[1,-1,2,-2],"private_key":"private_key_name","source":"local:///root/GIT/fairmath-cli/data/output/rotation_key_name","type":"rotation_key"},"sum_key_name":{"cryptocontext":"cryptocontext_name","dependencies":["cryptocontext_name","private_key_name"],"private_key":"private_key_name","source":"local:///root/GIT/fairmath-cli/data/output/sum_key_name","type":"sum_key"}} \ No newline at end of file diff --git a/data/output/cryptocontext_name b/data/output/cryptocontext_name deleted file mode 100644 index bfdc1ed..0000000 Binary files a/data/output/cryptocontext_name and /dev/null differ diff --git a/data/output/mult_key_name b/data/output/mult_key_name deleted file mode 100644 index 407a01f..0000000 Binary files a/data/output/mult_key_name and /dev/null differ diff --git a/data/output/private_key_name b/data/output/private_key_name deleted file mode 100644 index 23e0ffb..0000000 Binary files a/data/output/private_key_name and /dev/null differ diff --git a/data/output/public_key_name b/data/output/public_key_name deleted file mode 100644 index 642aa81..0000000 Binary files a/data/output/public_key_name and /dev/null differ diff --git a/data/output/rotation_key_name b/data/output/rotation_key_name deleted file mode 100644 index 2329dcb..0000000 Binary files a/data/output/rotation_key_name and /dev/null differ diff --git a/data/output/sum_key_name b/data/output/sum_key_name deleted file mode 100644 index dd68509..0000000 Binary files a/data/output/sum_key_name and /dev/null differ diff --git a/data/input/config.json b/example/input.json similarity index 100% rename from data/input/config.json rename to example/input.json diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..910b1a2 --- /dev/null +++ b/readme.md @@ -0,0 +1,66 @@ +# Fairmath KeyGen Application + +## Description +This application is supposed to use within the FHE app runner provided by fairmath computer actor. It is responsible for FHE key generation and encryption/decryption of user's data. This application relying on OpenFHE library to generate keys and making encryption. + +## How To Build +* Install CMake 3.22(or above), gcc or clang +* Install OpenMP(this is not necessary but highly recommended) +* Clone vcpkg repo and install binary + +```shell +$ git clone https://github.com/microsoft/vcpkg.git +$ cd vcpkg && ./bootstrap-vcpkg.sh +``` + +* Add the following env vars +```shell +$ export VCPKG_ROOT=/path/to/cloned/vcpkg/repo +$ export PATH=$VCPKG_ROOT:$PATH +``` + +You may also to add these variables to your `.bashrc` file for convenience. +* Clone `fairmath-cli` repository +```shell +$ git clone https://github.com/fairmath/fairmath-cli +``` +* Configure cmake and build the project. You should specify vcpkg path, build type and directory for cmake generated file. +```shell +$ VCPKG_ROOT=/path/to/cloned/vcpkg/repo BUILD_TYPE=Release BIN_DIR=rel cmake --preset=base && cmake --build .build/rel +``` +All files will be located in `.build` directory. You can omit VCPKG_ROOT variable if the one was defined previously(e.g. in the `.bashrc` file) +Also it is possible to create user defined presets for CMake. +Just create the following file in the root of the repository +CMakeUserPresets.json: +```json +{ + "version": 2, + "configurePresets": [ + { + "name": "dbg", + "inherits": "base", + "environment": { + "VCPKG_ROOT": "/path/to/cloned/vcpkg/repo", + "BUILD_TYPE": "Debug", + "BIN_DIR": "dbg" + } + }, + { + "name": "rel", + "inherits": "base", + "environment": { + "VCPKG_ROOT": "/path/to/cloned/vcpkg/repo", + "BUILD_TYPE": "Release", + "BIN_DIR": "rel" + } + } + ] +} +``` +Since that you are able to run the following command to build release configuration +```shell +$ cmake --preset=rel && cmake --build .build/rel +``` +Change rel to dbg to build a debug configuration. + +The very first build could take a time because of vcpkg will build 3rd party libraries for this project. NExt builds will be mush faster since 3rd party libraries will be already built and cached. \ No newline at end of file diff --git a/run.sh b/run.sh deleted file mode 100755 index 0708366..0000000 --- a/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -./BUILD/fairmathCli \ ---input_config="/root/GIT/fairmath-cli/data/input/config.json" \ ---output_crypto_objects="/root/GIT/fairmath-cli/data/output" \ ---output_config="/root/GIT/fairmath-cli/data/output/config.json" \ ---output_config_json_indent="-1" diff --git a/configProcessor.h b/src/configProcessor.h similarity index 85% rename from configProcessor.h rename to src/configProcessor.h index a848d9b..d6abd33 100644 --- a/configProcessor.h +++ b/src/configProcessor.h @@ -87,28 +87,87 @@ class ConfigProcessor final template [[nodiscard]] std::shared_ptr aquireKey( const std::string_view keyName); + [[nodiscard]] std::shared_ptr> aquireCC( const std::string_view ccName); template - void generateKeyPairAndSerialize( - const std::string_view keyName, - nlohmann::json& keyContent); + [[nodiscard]] inline auto& getKeyMap() noexcept + { + if constexpr (std::is_same_v, lbcrypto::PrivateKeyImpl>) + return m_privateKeyMap; + else + return m_publicKeyMap; + } + + template + [[nodiscard]] inline auto& getKeyFromKeyPair(lbcrypto::KeyPair& keyPair) noexcept + { + if constexpr (std::is_same_v, lbcrypto::PrivateKeyImpl>) + return keyPair.secretKey; + else + return keyPair.publicKey; + } + + template + void generateKeyPairAndSerialize(const std::string_view keyName, nlohmann::json& keyContent) + { + std::shared_ptr> cc = + aquireCC(keyContent["cryptocontext"].get()); + cc->Enable(lbcrypto::PKE); + lbcrypto::KeyPair keyPair = cc->KeyGen(); + const std::string& linkedKeyName + = keyContent["linked_key_for_generation"].get_ref(); + if (!linkedKeyName.empty()) + { + if (!(m_configJson[linkedKeyName]["linked_key_for_generation"].get() == keyName && + m_configJson[linkedKeyName]["source"].get().empty())) + { + throw std::runtime_error("Incorrect linking between keys"); + } + if constexpr (std::is_same_v>) + { + auto itKey = getKeyMap>().emplace( + linkedKeyName, std::move(getKeyFromKeyPair>(keyPair))).first; + serialize>(linkedKeyName, itKey->second); + } + else + { + auto itKey = getKeyMap>().emplace( + linkedKeyName, std::move(getKeyFromKeyPair>(keyPair))).first; + serialize>(linkedKeyName, itKey->second); + } + updateSource(linkedKeyName, m_configJson[linkedKeyName]); + } + else + { + if constexpr (std::is_same_v>) + { + serialize>(std::string(keyName) + "." + + m_configJson[linkedKeyName]["type"].get(), + getKeyFromKeyPair>(keyPair)); + } + else + { + serialize>(std::string(keyName) + "." + + m_configJson[linkedKeyName]["type"].get(), + getKeyFromKeyPair>(keyPair)); + } + } + auto itKey = getKeyMap().emplace(keyName, std::move(getKeyFromKeyPair(keyPair))).first; + const std::string keyNameStr(itKey->first); + serialize(keyNameStr, itKey->second); + updateSource(keyNameStr, keyContent); + } [[nodiscard]] std::shared_ptr> generateCC( const std::string_view ccName, const nlohmann::json& ccContent); + template [[nodiscard]] static lbcrypto::CCParams getCCParams( const nlohmann::json& ccContent); - template - [[nodiscard]] inline auto& getKeyMap() noexcept; - - template - [[nodiscard]] inline auto& getKeyFromKeyPair( - lbcrypto::KeyPair& keyPair) noexcept; - inline void updateSource( const std::string& filename, nlohmann::json& argContent); @@ -382,57 +441,6 @@ template return itCC->second; } -template -void ConfigProcessor::generateKeyPairAndSerialize(const std::string_view keyName, nlohmann::json& keyContent) -{ - std::shared_ptr> cc = - aquireCC(keyContent["cryptocontext"].get()); - cc->Enable(lbcrypto::PKE); - lbcrypto::KeyPair keyPair = cc->KeyGen(); - const std::string& linkedKeyName - = keyContent["linked_key_for_generation"].get_ref(); - if (!linkedKeyName.empty()) - { - if (!(m_configJson[linkedKeyName]["linked_key_for_generation"].get() == keyName && - m_configJson[linkedKeyName]["source"].get().empty())) - { - throw std::runtime_error("Incorrect linking between keys"); - } - if constexpr (std::is_same_v>) - { - auto itKey = getKeyMap>().emplace( - linkedKeyName, std::move(getKeyFromKeyPair>(keyPair))).first; - serialize>(linkedKeyName, itKey->second); - } - else - { - auto itKey = getKeyMap>().emplace( - linkedKeyName, std::move(getKeyFromKeyPair>(keyPair))).first; - serialize>(linkedKeyName, itKey->second); - } - updateSource(linkedKeyName, m_configJson[linkedKeyName]); - } - else - { - if constexpr (std::is_same_v>) - { - serialize>(std::string(keyName) + "." + - m_configJson[linkedKeyName]["type"].get(), - getKeyFromKeyPair>(keyPair)); - } - else - { - serialize>(std::string(keyName) + "." + - m_configJson[linkedKeyName]["type"].get(), - getKeyFromKeyPair>(keyPair)); - } - } - auto itKey = getKeyMap().emplace(keyName, std::move(getKeyFromKeyPair(keyPair))).first; - const std::string keyNameStr(itKey->first); - serialize(keyNameStr, itKey->second); - updateSource(keyNameStr, keyContent); -} - [[nodiscard]] std::shared_ptr> ConfigProcessor::generateCC( const std::string_view ccName, const nlohmann::json& ccContent) { @@ -522,24 +530,6 @@ template return params; } -template -[[nodiscard]] inline auto& ConfigProcessor::getKeyMap() noexcept -{ - if constexpr (std::is_same_v, lbcrypto::PrivateKeyImpl>) - return m_privateKeyMap; - else - return m_publicKeyMap; -} - -template -[[nodiscard]] inline auto& ConfigProcessor::getKeyFromKeyPair(lbcrypto::KeyPair& keyPair) noexcept -{ - if constexpr (std::is_same_v, lbcrypto::PrivateKeyImpl>) - return keyPair.secretKey; - else - return keyPair.publicKey; -} - inline void ConfigProcessor::updateSource(const std::string& filename, nlohmann::json& argContent) { static const std::string path = "local://" + m_outputCryptoObjectsDirectory; diff --git a/fairmathCli.cpp b/src/fairmathCli.cpp similarity index 100% rename from fairmathCli.cpp rename to src/fairmathCli.cpp diff --git a/utils.h b/src/utils.h similarity index 100% rename from utils.h rename to src/utils.h diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..6aac9de --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,24 @@ +{ + "default-registry": { + "kind": "git", + "baseline": "834977918592e4f5d5ec5fe48ba338c608faf9f9", + "repository": "https://github.com/microsoft/vcpkg" + }, + "registries": [ + { + "kind": "artifact", + "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", + "name": "microsoft" + }, + { + "kind": "git", + "baseline": "2e613ed3bf95350c601bd0c68f64e91c343d2675", + "repository": "https://github.com/fairmath/vcpkg-registry", + "reference": "master", + "packages": [ + "openfhe", + "nlohmann-json" + ] + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..536a3c5 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,7 @@ +{ + "dependencies": [ + "openfhe", + "boost-program-options", + "nlohmann-json" + ] +}