Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catchup: into main from long_lived/blastwjb @ 95c2f65073c366a3621e304adc066b7e675cf907 #409

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
143e817
first pass
wjblanke Jun 2, 2023
1e99e7a
bn_t
wjblanke Jun 2, 2023
3fdd03f
more fixes
wjblanke Jun 3, 2023
a654e98
more fixes
wjblanke Jun 3, 2023
5b1ff23
more fixes
wjblanke Jun 3, 2023
2ffd581
more fixes
wjblanke Jun 3, 2023
b693544
more fixes
wjblanke Jun 3, 2023
2be7c16
more fixes
wjblanke Jun 3, 2023
443875e
more fixes
wjblanke Jun 3, 2023
8cc4e85
more fixes
wjblanke Jun 4, 2023
6f687d1
more fixes
wjblanke Jun 4, 2023
f167a85
more fixes
wjblanke Jun 4, 2023
64b1547
more fixes
wjblanke Jun 4, 2023
b11e8e5
more fixes
wjblanke Jun 4, 2023
2dcc151
more fixes
wjblanke Jun 4, 2023
5c86319
more fixes
wjblanke Jun 4, 2023
9f6ea3f
more fixes
wjblanke Jun 4, 2023
b621fda
more fixes
wjblanke Jun 4, 2023
65d9f8f
more fixes
wjblanke Jun 4, 2023
b6403c1
more fixes
wjblanke Jun 4, 2023
4f2b5b0
more fixes
wjblanke Jun 4, 2023
06ce7ab
link
wjblanke Jun 4, 2023
a7b6093
fix private key
wjblanke Jun 4, 2023
250483c
fixes..maybe
wjblanke Jun 5, 2023
8b4cb49
fix ubuntu
wjblanke Jun 5, 2023
ec89afd
affine fix
wjblanke Jun 5, 2023
bbd0f29
use blst keygen
wjblanke Jun 5, 2023
bc0118e
cleanup
wjblanke Jun 5, 2023
b38c540
test couts
wjblanke Jun 5, 2023
5764c25
Verification working - along with other fixes
emlowe Jun 5, 2023
38b431e
Some fixes - PopVerify is broken
emlowe Jun 5, 2023
88bcafa
PopProve and PopVerify are working
emlowe Jun 5, 2023
1aa2618
fixed python bindings by removing mul and rmul
wjblanke Jun 5, 2023
8ef1883
More fixes and improvements
emlowe Jun 5, 2023
937a3a5
cmake
wjblanke Jun 6, 2023
fda4d55
remove gmp
wjblanke Jun 6, 2023
58a6073
Use _bendian instead
emlowe Jun 6, 2023
11a31d0
Handle infinity similar to bls-signatures did before
emlowe Jun 6, 2023
a67278c
fix cmake
wjblanke Jun 6, 2023
5eaf52d
Fixed up issues with unhardned - all tests pass
emlowe Jun 6, 2023
21a7980
Fix up PrivateKey deserialization and checks
emlowe Jun 6, 2023
b766fb5
put back proper iterations into benchmarks
emlowe Jun 6, 2023
6599e05
hopeful fixes
wjblanke Jun 7, 2023
eab697d
hopeful fixes
wjblanke Jun 7, 2023
bef4553
change workflows
wjblanke Jun 7, 2023
1853a8f
msvc extension
wjblanke Jun 7, 2023
9282fae
windows
wjblanke Jun 7, 2023
ccf8f7e
ml64
wjblanke Jun 7, 2023
5a3077b
fix
wjblanke Jun 7, 2023
65e4251
fix
wjblanke Jun 7, 2023
87a0352
fix
wjblanke Jun 7, 2023
28dd06e
fix
wjblanke Jun 7, 2023
6df6550
fix
wjblanke Jun 7, 2023
fc70696
static lib for asm
wjblanke Jun 7, 2023
b6b599d
fix workflow
wjblanke Jun 7, 2023
5db6545
fix
wjblanke Jun 7, 2023
14986f4
fix
wjblanke Jun 7, 2023
22c8bd6
added binary lib
wjblanke Jun 7, 2023
495dda0
temp comment assert
wjblanke Jun 7, 2023
7337ae3
temp comment assert
wjblanke Jun 7, 2023
1906119
remove relic from js
wjblanke Jun 7, 2023
682a7f9
remove Bignum from js bindings
wjblanke Jun 8, 2023
2f3fac4
scrub bn_t
wjblanke Jun 8, 2023
796cdf4
remove mul bindings
wjblanke Jun 8, 2023
7336ef3
Fix pairing with operator& (#386)
emlowe Jun 9, 2023
70bb402
Adding pre-release vs release logic (#384)
wallentx Jun 9, 2023
f560357
Update README.md (#387)
emlowe Jun 9, 2023
5584632
Scrub some references to relic (#388)
emlowe Jun 9, 2023
10b3161
Scrub references to gmp (#389)
emlowe Jun 9, 2023
29aabf9
Add GTElement serialization with memcpy (#390)
emlowe Jun 12, 2023
f243e18
Use _add_or_double instead of just _add and pin BLST to specific revi…
emlowe Jun 13, 2023
22f60a1
Disable npmjs publish on pre-release (#392)
wallentx Jun 13, 2023
9a9cedb
Use sizeof(blst_fp12) for size of GTElement serialization (#395)
emlowe Jun 15, 2023
7b3c3e3
Merge main into long_lived and fixup conflicts (#397)
emlowe Jun 20, 2023
f9ba417
macOS wheel, CMake and Windows builds improvements (#400)
AmineKhaldi Jun 20, 2023
e7eafc2
Minor fix to making pybind11 available (#403)
AmineKhaldi Jun 20, 2023
4c8bf46
Merge commit 'f1d860c13db2c06f54196ccf716b3125d88ebc31' into catchup/…
AmineKhaldi Jun 20, 2023
ec18617
Merge pull request #404 from Chia-Network/catchup/long_lived_blastwjb…
wallentx Jun 20, 2023
2b6e809
Some CodeQL directed code cleanup (#406)
emlowe Jun 20, 2023
95c2f65
Some more codeql cleanup (#408)
emlowe Jun 20, 2023
a0cf978
Merge commit '95c2f65073c366a3621e304adc066b7e675cf907' into catchup/…
AmineKhaldi Jun 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ jobs:
- name: Mac OS build C++ and test
if: startsWith(matrix.os, 'macos')
run: |
ls -l
export MACOSX_DEPLOYMENT_TARGET=10.14
mkdir -p build
ls -l build
cd build
cmake ../
cmake --build . -- -j 6
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- main
tags:
- '**'
release:
types: [published]
pull_request:
branches:
- '**'
Expand Down Expand Up @@ -45,25 +45,25 @@ jobs:
cibw-build: 'cp37-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
intel: manylinux2014
matrix: '3.7'
- major-dot-minor: '3.8'
cibw-build: 'cp38-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
intel: manylinux2014
matrix: '3.8'
- major-dot-minor: '3.9'
cibw-build: 'cp39-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
intel: manylinux2014
matrix: '3.9'
- major-dot-minor: '3.10'
cibw-build: 'cp310-*'
manylinux:
arm: manylinux2014
intel: manylinux2010
intel: manylinux2014
matrix: '3.10'
- major-dot-minor: '3.11'
cibw-build: 'cp311-*'
Expand Down Expand Up @@ -112,6 +112,11 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: chia-network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
Expand Down Expand Up @@ -139,18 +144,13 @@ jobs:
&& curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-`uname -m`.sh > cmake.sh
&& yes | sh cmake.sh | cat
&& rm -f /usr/bin/cmake
&& curl -L https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz | tar x --lzip
&& cp contrib/gmp-patch-6.2.1/longlong.h gmp-6.2.1/
&& cp contrib/gmp-patch-6.2.1/compat.c gmp-6.2.1/
&& cd gmp-6.2.1 && ./configure --enable-fat
&& make && make install && cd .. && rm -rf gmp-6.2.1
&& cmake --version
&& uname -a
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install --upgrade pip
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
CIBW_BEFORE_ALL_MACOS: >
brew install gmp boost cmake
brew install cmake
CIBW_BEFORE_BUILD_MACOS: >
python -m pip install --upgrade pip
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=10.14"
Expand Down Expand Up @@ -193,6 +193,11 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
Expand Down Expand Up @@ -303,15 +308,15 @@ jobs:
run: pip install twine

- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
if: env.RELEASE == 'true' && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'

- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
if: env.PRE_RELEASE == 'true' && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/js-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
branches:
- main
tags:
- '**'
release:
types: [published]
pull_request:
branches:
- '**'
Expand All @@ -23,6 +23,11 @@ jobs:
with:
fetch-depth: 0

- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -46,7 +51,7 @@ jobs:
run: ./js_build.sh

- name: Publish
if: startsWith(github.ref, 'refs/tags/')
if: env.FULL_RELEASE == 'true'
working-directory: ${{ github.workspace }}/js_build/js-bindings
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/relic-nightly.yml

This file was deleted.

Empty file modified .github/workflows/stale-issue.yml
100755 → 100644
Empty file.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ 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
contrib/gmp-6.1.2/

.idea
.vscode
Expand Down
132 changes: 14 additions & 118 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ endif()

project(BLS)

if(MSVC)
enable_language(ASM_MASM)
else()
enable_language(ASM)
endif()

set(BUILD_BLS_PYTHON_BINDINGS "1" CACHE STRING "")
set(BUILD_BLS_TESTS "1" CACHE STRING "")
set(BUILD_BLS_BENCHMARKS "1" CACHE STRING "")
Expand All @@ -33,6 +39,7 @@ include(FetchContent)

FetchContent_Declare(Sodium
GIT_REPOSITORY https://github.com/AmineKhaldi/libsodium-cmake.git

# Latest commit at the moment this was added here
# Anchored to libsodium v1.0.18
GIT_TAG f73a3fe1afdc4e37ac5fe0ddd401bf521f6bba65
Expand All @@ -42,128 +49,17 @@ 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")
set(RELIC_REPOSITORY "https://github.com/relic-toolkit/relic.git")
else()
# This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5
set(RELIC_GIT_TAG "2a4ed8ded3a9a5ac5e39f3877f357264b2e16f11")
set(RELIC_REPOSITORY "https://github.com/Chia-Network/relic.git")
endif()
set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc")
set(BLST_REPOSITORY "https://github.com/supranational/blst")

message(STATUS "Relic will be built from: ${RELIC_GIT_TAG} and repository ${RELIC_REPOSITORY}")
message(STATUS "blst will be built from: ${BLST_GIT_TAG} and repository ${BLST_REPOSITORY}")

FetchContent_Declare(
relic
GIT_REPOSITORY ${RELIC_REPOSITORY}
GIT_TAG ${RELIC_GIT_TAG}
blst
GIT_REPOSITORY ${BLST_REPOSITORY}
GIT_TAG ${BLST_GIT_TAG}
)

# Relic related options

set(STBIN "off" CACHE STRING "Relic - Build static binaries")

if(MSVC)
set(ARITH "gmp" CACHE STRING "")
# We'll be using our custom MPIR build instead of GMP for MSVC builds
FetchContent_Declare(
chia_mpir
GIT_REPOSITORY https://github.com/Chia-Network/mpir_gc_x64.git
GIT_SHALLOW true
)
FetchContent_MakeAvailable(chia_mpir)
set(MPIR_INCLUDE_DIR ${chia_mpir_SOURCE_DIR} CACHE STRING "")
set(MPIR_IMPLIB "${chia_mpir_SOURCE_DIR}/mpir.lib" CACHE STRING "")
else()
find_package(gmp)
if(GMP_FOUND)
message(STATUS "Found libgmp")
set(ARITH "gmp" CACHE STRING "")
else()
set(ARITH "easy" CACHE STRING "")
endif()
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(WSIZE "32" CACHE STRING "Relic - Processor word size")
else()
set(WSIZE "64" CACHE STRING "Relic - Processor word size")
endif()

if(EMSCRIPTEN)
# emscripten needs arch set to be none since it can't compile assembly
set(ARCH "" CACHE STRING "")
# emscripten is a 32 bit compiler
set(WSIZE "32" CACHE STRING "Relic - Processor word size")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(TIMER "ANSI" CACHE STRING "")
set(MULTI "OPENMP" CACHE STRING "")
else()
set(TIMER "CYCLE" CACHE STRING "")
set(MULTI "PTHREAD" CACHE STRING "")
endif()

set(CHECK "off" CACHE STRING "")
set(VERBS "off" CACHE STRING "")
set(ALLOC "AUTO" CACHE STRING "")
set(SHLIB "off" CACHE STRING "")
set(DOCUM "off" CACHE STRING "")
set(FP_PRIME "381" CACHE STRING "Relic - Prime modulus size")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(SEED "UDEV" CACHE STRING "")
set(FP_QNRES "off" CACHE STRING "")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(SEED "WCGR" CACHE STRING "")
set(FP_QNRES "on" CACHE STRING "")
else()
set(SEED "UDEV" CACHE STRING "")
set(FP_QNRES "on" CACHE STRING "")
endif()

if(DEFINED ENV{RELIC_MAIN})
set(FP_METHD "INTEG;INTEG;INTEG;MONTY;LOWER;JMPDS;SLIDE" CACHE STRING "")
if(MSVC)
set(CFLAGS "" CACHE STRING "")
else()
set(CFLAGS "-O3 -funroll-loops -fomit-frame-pointer" CACHE STRING "")
endif()
else()
set(FP_METHD "INTEG;INTEG;INTEG;MONTY;LOWER;SLIDE" CACHE STRING "")
if(MSVC)
set(COMP_FLAGS "" CACHE STRING "")
else()
set(COMP_FLAGS "-O3 -funroll-loops -fomit-frame-pointer" CACHE STRING "")
endif()
endif()

set(FP_PMERS "off" CACHE STRING "")
set(FPX_METHD "INTEG;INTEG;LAZYR" CACHE STRING "")
set(EP_PLAIN "off" CACHE STRING "")
set(EP_SUPER "off" CACHE STRING "")
# Disable relic tests and benchmarks
set(TESTS "0" CACHE STRING "Relic - Number of times each test is ran")
set(BENCH "0" CACHE STRING "Relic - Number of times each benchmark is ran")

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)

function(handle_mpir_dlls _target)
file(GLOB chia_mpir_dlls ${chia_mpir_SOURCE_DIR}/*.dll)
foreach(mpir_dll IN LISTS chia_mpir_dlls)
add_custom_command(
TARGET ${_target}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${mpir_dll} $<TARGET_FILE_DIR:${_target}>
)
endforeach()
endfunction()
FetchContent_MakeAvailable(blst)

add_subdirectory(src)

Expand Down
Loading