Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
ladnir committed Nov 6, 2023
2 parents ec8eae3 + f97d98b commit 4acf55c
Show file tree
Hide file tree
Showing 190 changed files with 27,932 additions and 9,594 deletions.
81 changes: 38 additions & 43 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, stage ]
pull_request: {}
branches: [ master, stage, components ]
pull_request:
branches: [ master, stage, components ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -18,6 +19,7 @@ jobs:
build-ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-latest
timeout-minutes: 30

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -27,17 +29,15 @@ jobs:
submodules: recursive

# Runs a set of commands using the runners shell
- name: build boost
run: python3 build.py --setup --boost --par=4


- name: build relic
run: python3 build.py --setup --relic --par=4

run: python3 build.py --setup --relic --par=4 -DVERBOSE_FETCH=ON -DENABLE_BOOST=OFF -DENABLE_SODIUM=OFF -DENABLE_ASAN=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: build bitpolymul
run: python3 build.py --setup --bitpolymul --par=4
run: python3 build.py --setup --bitpolymul --par=4 -DVERBOSE_FETCH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

- name: build libOTe
run: python3 build.py --par=4 -D ENABLE_ALL_OT=ON -D ENABLE_RELIC=ON -DENABLE_CIRCUIT=ON -DENABLE_BITPOLYMUL=ON
run: python3 build.py --par=4 -D ENABLE_ALL_OT=ON -DENABLE_CIRCUITS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo

- name: unit tests
run: ./out/build/linux/frontend/frontend_libOTe -u
Expand All @@ -46,7 +46,7 @@ jobs:
- name: find source tree
run: |
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -D CMAKE_PREFIX_PATH=../../
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_PREFIX_PATH=../../
cmake --build out/
./out/main
rm -rf out/
Expand All @@ -63,10 +63,9 @@ jobs:
- name: install prefix test
run: |
python3 build.py --setup --boost --relic --bitpolymul --install=~/install
python3 build.py --install=~/install
python3 build.py --install=~/install -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=~/install
cmake --build out/
./out/main
rm -rf out/
Expand All @@ -75,20 +74,23 @@ jobs:
- name: install test
run: |
python3 build.py --setup --boost --relic --bitpolymul --install --sudo
python3 build.py --install --sudo
python3 build.py --setup --relic --bitpolymul --install --sudo -DCMAKE_BUILD_TYPE=RelWithDebInfo
python3 build.py --install --sudo -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build out/
./out/main
rm -rf out/
cd ../..

- name: build sodium
run: python3 build.py --setup --sodium --par=4
run: python3 build.py --setup --sodium --par=4 -DVERBOSE_FETCH=ON -DENABLE_BOOST=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo

- name: build libOTe
run: python3 build.py --par=4 -D ENABLE_ALL_OT=ON -D ENABLE_SODIUM=ON -DENABLE_RELIC=OFF
run: |
rm ./out/build/linux/frontend/frontend_libOTe
python3 build.py --par=4 -D ENABLE_ALL_OT=ON -D ENABLE_SODIUM=ON -DENABLE_RELIC=OFF -DPRINT_LOG_ON_FAIL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: unit tests
run: ./out/build/linux/frontend/frontend_libOTe -u
Expand All @@ -97,7 +99,7 @@ jobs:
- name: find source tree
run: |
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -D CMAKE_PREFIX_PATH=../../
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSODIUM=ON -D CMAKE_PREFIX_PATH=../../
cmake --build out/
./out/main
rm -rf out/
Expand All @@ -106,18 +108,18 @@ jobs:
- name: hint test
run: |
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -D LIBOTE_HINT=../..
cmake -S . -B out/ -DSODIUM=ON -D LIBOTE_HINT=../..
cmake --build out/
./out/main
rm -rf out/
cd ../..
- name: install prefix test
run: |
python3 build.py --setup --boost --relic --sodium --install=~/install
python3 build.py --install=~/install
python3 build.py --setup --sodium --install=~/install -DCMAKE_BUILD_TYPE=RelWithDebInfo
python3 build.py --install=~/install -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
cmake -S . -B out/ -DSODIUM=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=~/install
cmake --build out/
./out/main
rm -rf out/
Expand All @@ -126,10 +128,10 @@ jobs:
- name: install test
run: |
python3 build.py --setup --boost --sodium --install --sudo
python3 build.py --install --sudo
python3 build.py --setup --sodium --install --sudo -DCMAKE_BUILD_TYPE=RelWithDebInfo
python3 build.py --install --sudo -DCMAKE_BUILD_TYPE=RelWithDebInfo
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release
cmake -S . -B out/ -DSODIUM=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build out/
./out/main
rm -rf out/
Expand All @@ -139,6 +141,7 @@ jobs:
build-osx:
# The type of runner that the job will run on
runs-on: macos-latest
timeout-minutes: 20

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -148,15 +151,9 @@ jobs:
submodules: recursive

# Runs a set of commands using the runners shell
- name: build boost
run: python3 build.py --setup --boost --par=4

- name: build relic
run: python3 build.py --setup --relic --par=4

- name: build libOTe
run: |
python3 build.py --par=4 -D ENABLE_ALL_OT=ON -D ENABLE_RELIC=ON -D ENABLE_SSE=OFF
run: python3 build.py -DENABLE_BOOST=OFF -DVERBOSE_FETCH=ON -DENABLE_SSE=OFF -DENABLE_RELIC=ON -D ENABLE_ALL_OT=ON

- name: unit tests
run: ./out/build/osx/frontend/frontend_libOTe -u
Expand All @@ -182,7 +179,7 @@ jobs:
- name: install prefix test
run: |
python3 build.py --setup --boost --relic --install=~/install
python3 build.py --setup --relic --install=~/install
python3 build.py --install=~/install
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
Expand All @@ -194,7 +191,7 @@ jobs:
- name: install test
run: |
python3 build.py --setup --boost --relic --install --sudo
python3 build.py --setup --relic --install --sudo
python3 build.py --install --sudo
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release
Expand All @@ -206,7 +203,8 @@ jobs:
build-windows:
# The type of runner that the job will run on
runs-on: windows-latest
runs-on: windows-2019
timeout-minutes: 30

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -218,14 +216,11 @@ jobs:
- uses: ilammy/msvc-dev-cmd@v1

# Runs a set of commands using the runners shell
- name: build boost
run: python3 build.py --setup --boost --par=4 -G Ninja

- name: build relic
run: python3 build.py --setup --relic --par=4 -G Ninja
run: python3 build.py --setup --relic --par=1 -G Ninja -DENABLE_BOOST=OFF -DVERBOSE_FETCH=ON

- name: build libOTe
run: python3 build.py --par=4 -D ENABLE_ALL_OT=ON -D ENABLE_RELIC=ON -G Ninja
run: python3 build.py --par=1 -D ENABLE_ALL_OT=ON -D ENABLE_RELIC=ON -G Ninja


- name: unit test
Expand Down Expand Up @@ -253,10 +248,10 @@ jobs:
- name: install prefix test
run: |
python3 build.py --relic --boost --bitpolymul --install=~/install
python3 build.py --relic --bitpolymul --install=~/install
cd libOTe_Tests/cmakeTests
cmake -S . -B out/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/install
cmake --build out/ --config Release
./out/Release/main.exe
rm -r -fo out/
cd ../..
cd ../..
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "cryptoTools"]
path = cryptoTools
url = https://github.com/ladnir/cryptoTools.git
url = https://github.com/ladnir/cryptotools
43 changes: 29 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,33 @@ if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)

project(libOTe VERSION 1.5.1)
project(libOTe VERSION 2.1.0)

include(cmake/libOTePreamble.cmake)

if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")

############################################
# If top level cmake #
############################################

############################################
# Flag and #defines #
############################################
add_definitions(-DSOLUTION_DIR='${CMAKE_SOURCE_DIR}')
if(MSVC)

# optionally add the following to CMAKE_PREFIX_PATH
if(NOT DEFINED CMAKE_PREFIX_PATH AND NOT DEFINED NO_OC_DEFAULT_PREFIX)
set(CMAKE_PREFIX_PATH
"c:/libs"
"${CMAKE_CURRENT_LIST_DIR}/..;"
)
endif()

else()
set(COMMON_FLAGS "-Wall -march=native -Wfatal-errors")
set(COMMON_FLAGS "-Wall -Wfatal-errors")
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -O2 -g -ggdb")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
endif()
#set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")


############################################
# Build mode checks #
Expand All @@ -60,6 +53,28 @@ if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
endif()


if(DEFINED LIBOTE_CPP_VER)
message("warning: setting LIBOTE_STD_VER as LIBOTE_CPP_VER=${LIBOTE_CPP_VER}")
set(LIBOTE_STD_VER ${LIBOTE_CPP_VER})
unset(LIBOTE_CPP_VER CACHE )
endif()
if(NOT DEFINED LIBOTE_STD_VER)
set(LIBOTE_STD_VER 17)
endif()
if(NOT LIBOTE_STD_VER EQUAL 20 AND
NOT LIBOTE_STD_VER EQUAL 17)
message(FATAL_ERROR "Unknown c++ version. LIBOTE_STD_VER=${LIBOTE_STD_VER}")
endif()
set(CRYPTO_TOOLS_STD_VER ${LIBOTE_STD_VER})
if(NOT DEFINED ENABLE_COPROTO)
set(ENABLE_COPROTO true)
endif()
if(NOT ENABLE_COPROTO)
message("warning: setting ENABLE_BOOST as true")
set(ENABLE_COPROTO true)
endif()


#############################################
# Build cryptoTools (common utilities) #
#############################################
Expand Down
90 changes: 90 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"version": 2,
"configurePresets": [
{
"name": "linux",
"displayName": "Linux",
"description": "Target the Windows Subsystem for Linux (WSL) or a remote Linux system.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_ALL_OT": true,
"ENABLE_SSE": false,
"ENABLE_AVX": false,
"ENABLE_BITPOLYMUL": false,
"LIBOTE_STD_VER": "17",
"CMAKE_PREFIX_PATH": "${sourceDir}/../out/install",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
}
},
{
"name": "x64-Debug",
"displayName": "Windows x64 Debug",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_INSECURE_SILVER": false,
"ENABLE_LDPC": false,
"LIBOTE_STD_VER": "17",
"ENABLE_ALL_OT": true,
"ENABLE_KKRT": "ON",
"ENABLE_IKNP": "ON",
"ENABLE_MR": "ON",
"ENABLE_SIMPLESTOT": "ON",
"ENABLE_RELIC": false,
"ENABLE_SODIUM": true,
"ENABLE_BOOST": false,
"ENABLE_BITPOLYMUL": true,
"FETCH_AUTO": "ON",
"ENABLE_CIRCUITS": true,
"VERBOSE_FETCH": true,
"ENABLE_SSE": true,
"ENABLE_AVX": true,
"ENABLE_ASAN": true,
"COPROTO_ENABLE_BOOST": true,
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_PREFIX_PATH": "${sourceDir}/../out/install/${presetName}"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
},
{
"name": "x64-Release",
"displayName": "Windows x64 Release",
"description": "Target Windows with the Visual Studio development environment.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"LIBOTE_STD_VER": "17",
"ENABLE_ALL_OT": true,
"ENABLE_RELIC": true,
"ENABLE_SODIUM": true,
"ENABLE_BOOST": true,
"ENABLE_OPENSSL": false,
"FETCH_AUTO": true,
"ENABLE_CIRCUITS": true,
"ENABLE_BITPOLYMUL": true,
"VERBOSE_FETCH": true,
"ENABLE_PIC": true,
"ENABLE_ASAN": false,
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
},
"vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
}
]
}
Loading

0 comments on commit 4acf55c

Please sign in to comment.