Skip to content

Commit

Permalink
Merge pull request dashpay#42 from kittywhiskers/relic
Browse files Browse the repository at this point in the history
build: commit relic-toolkit/relic@aecdcae to source tree as vendored
  • Loading branch information
PastaPastaPasta authored Sep 22, 2022
2 parents 057ca01 + f481db9 commit 4da22c2
Show file tree
Hide file tree
Showing 696 changed files with 226,025 additions and 31 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ main
.o
obj/
src/*.o
contrib/relic/CTestTestfile.cmake
contrib/relic/bench/CTestTestfile.cmake
contrib/relic/bin
contrib/relic/include/relic_conf.h
contrib/relic/test/CTestTestfile.cmake
depends/relic/CTestTestfile.cmake
depends/relic/bench/CTestTestfile.cmake
depends/relic/bin
depends/relic/include/relic_conf.h
depends/relic/test/CTestTestfile.cmake
contrib/gmp-6.1.2/

.idea
Expand Down
18 changes: 1 addition & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ set(SODIUM_DISABLE_TESTS "on" CACHE STRING "")
set(SODIUM_CHIA_MINIMAL "on" CACHE STRING "")
FetchContent_MakeAvailable(Sodium)

if (DEFINED ENV{RELIC_MAIN})
set(RELIC_GIT_TAG "origin/main")
else ()
# This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5
set(RELIC_GIT_TAG "215c69966cb78b255995f0ee9c86bbbb41c3c42b")
endif ()

message(STATUS "Relic will be built from: ${RELIC_GIT_TAG}")

FetchContent_Declare(
relic
GIT_REPOSITORY https://github.com/Chia-Network/relic.git
GIT_TAG ${RELIC_GIT_TAG}
)

# Relic related options

set(STBIN "off" CACHE STRING "Relic - Build static binaries")
Expand Down Expand Up @@ -128,8 +113,7 @@ set(QUIET "on" CACHE STRING "Relic - Build with printing disabled")
set(PP_EXT "LAZYR" CACHE STRING "")
set(PP_METHD "LAZYR;OATEP" CACHE STRING "")

FetchContent_MakeAvailable(relic)

add_subdirectory(depends/relic)
add_subdirectory(src)

if(EMSCRIPTEN)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ On a 3.5 GHz i7 Mac, verification takes about 1.1ms per signature, and signing t
### Link the library to use it

```bash
g++ -Wl,-no_pie -std=c++11 -Ibls-signatures/build/_deps/relic-src/include -Ibls-signatures/build/_deps/relic-build/include -Ibls-signatures/src -L./bls-signatures/build/ -l bls yourapp.cpp
g++ -Wl,-no_pie -std=c++11 -Ibls-signatures/depends/relic/include -Ibls-signatures/build/depends/relic/include -Ibls-signatures/src -L./bls-signatures/build/ -l bls yourapp.cpp
```

## Notes on dependencies
Expand Down
7 changes: 7 additions & 0 deletions depends/relic/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# top-most EditorConfig file
root = true

# 4 space indentation
[*.{cmake,c,h}]
indent_style = tab
indent_size = 4
48 changes: 48 additions & 0 deletions depends/relic/.github/workflows/16bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Basic configuration (16 bits)

on:
push:
branches:
- '**' # all branches
pull_request:
branches:
- '**' # all branches

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest,
cc: "gcc",
}
- {
name: "Ubuntu Latest - Clang",
artifact: "linux-clang.tar.xz",
os: ubuntu-latest,
cc: "clang",
}
steps:
- uses: actions/checkout@v2

- name: Run CMake (standard)
if: ${{ !(runner.os == 'Windows') }}
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DWSIZE=16 -DSEED= -DBENCH=0 -DTESTS=10 ..
- name: CMake Build
run: cmake --build build

- name: CMake Test
run: |
cd build
ctest --verbose .
97 changes: 97 additions & 0 deletions depends/relic/.github/workflows/32bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Basic configuration (32 bits)

on:
push:
branches:
- '**' # all branches
pull_request:
branches:
- '**' # all branches

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest - MSVC",
artifact: "windows-msvc.tar.xz",
os: windows-latest,
cc: "cl",
}
- {
name: "Windows Latest - MinGW",
artifact: "windows-mingw.tar.xz",
os: windows-latest,
cc: "gcc"
}
- {
name: "Ubuntu Latest - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest,
cc: "gcc",
}
- {
name: "Ubuntu Latest - Clang",
artifact: "linux-clang.tar.xz",
os: ubuntu-latest,
cc: "clang",
}
- {
name: "MacOS Latest",
os: macos-latest,
cc: "clang",
}
steps:
- uses: actions/checkout@v2

- name: Set Windows enviroment
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'cl') }}
uses: ilammy/msvc-dev-cmd@v1

- name: Set MinGW enviroment
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'gcc') }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
git
base-devel
gcc
cmake
update: true

- name: Run CMake (Win)
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'cl') }}
shell: bash
run: |
mkdir build
cd build
cmake -DWSIZE=32 -DSEED= -DBENCH=0 -G "NMake Makefiles" ..
- name: Run CMake (MingW)
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'gcc') }}
shell: bash
run: |
mkdir build
cd build
cmake -DWSIZE=32 -DSEED= -DBENCH=0 -G "MinGW Makefiles" ..
- name: Run CMake (standard)
if: ${{ !(runner.os == 'Windows') }}
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DWSIZE=32 -DSEED= -DBENCH=0 ..
- name: CMake Build
run: cmake --build build

- name: CMake Test
run: |
cd build
ctest --verbose .
48 changes: 48 additions & 0 deletions depends/relic/.github/workflows/8bit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Basic configuration (8 bits)

on:
push:
branches:
- '**' # all branches
pull_request:
branches:
- '**' # all branches

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu Latest - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest,
cc: "gcc",
}
- {
name: "Ubuntu Latest - Clang",
artifact: "linux-clang.tar.xz",
os: ubuntu-latest,
cc: "clang",
}
steps:
- uses: actions/checkout@v2

- name: Run CMake (standard)
if: ${{ !(runner.os == 'Windows') }}
shell: bash
run: |
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DWSIZE=8 -DSEED= -DBENCH=0 -DTESTS=10 ..
- name: CMake Build
run: cmake --build build

- name: CMake Test
run: |
cd build
ctest --verbose .
91 changes: 91 additions & 0 deletions depends/relic/.github/workflows/bls12-381.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: BLS12-381 configuration (ASM)

on:
push:
branches:
- '**' # all branches
pull_request:
branches:
- '**' # all branches

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
#- {
#name: "Windows Latest - MinGW",
#artifact: "windows-mingw.tar.xz",
#os: windows-latest,
#cc: "gcc"
#}
- {
name: "Ubuntu Latest - GCC",
artifact: "linux-gcc.tar.xz",
os: ubuntu-latest,
cc: "gcc",
}
- {
name: "Ubuntu Latest - Clang",
artifact: "linux-clang.tar.xz",
os: ubuntu-latest,
cc: "clang",
}
- {
name: "MacOS Latest",
os: macos-latest,
cc: "clang",
}
steps:
- uses: actions/checkout@v2

- name: Install Linux Dependencies
if: runner.os == 'Linux'
run: sudo apt install libgmp-dev

- name: Install MacOS Dependencies
if: runner.os == 'MacOS'
run: brew install gmp

- name: Set MinGW enviroment
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'gcc') }}
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
git
base-devel
gcc
cmake
gmp
update: true

- name: Run CMake (MingW)
if: ${{ (runner.os == 'Windows') && (matrix.config.cc == 'gcc') }}
shell: bash
run: |
mkdir build
cd build
cmake -G "MinGW Makefiles" ..
../preset/x64-pbc-bls12-381.sh .
cmake -DSEED= -DBENCH=0 -DSTBIN=off -DRAND=HASHD .
- name: Run CMake (standard)
if: ${{ !(runner.os == 'Windows') }}
shell: bash
run: |
mkdir build
cd build
../preset/x64-pbc-bls12-381.sh ../
cmake -DCMAKE_C_COMPILER=${{ matrix.config.cc }} -DSEED= -DBENCH=0 .
- name: CMake Build
run: cmake --build build

- name: CMake Test
run: |
cd build
ctest --verbose .
Loading

0 comments on commit 4da22c2

Please sign in to comment.