![tecnovert@tecnovert.net](/assets/img/avatar_default.png)
51 changed files with 1395 additions and 1051 deletions
@ -0,0 +1,8 @@ |
|||
# TODO: move this to pyproject.toml when supported: https://gitlab.com/pycqa/flake8/-/issues/428 |
|||
|
|||
[flake8] |
|||
select = B,C,E,F,W,B001,B003,B006,B007,B301,B305,B306,B902,Q000,Q001,Q002,Q003 |
|||
ignore = E203,E722,W503 |
|||
exclude = .tox,build |
|||
max-line-length = 120 |
|||
per-file-ignores = coincurve/__init__.py:F401 |
@ -0,0 +1,5 @@ |
|||
github: |
|||
- ofek |
|||
custom: |
|||
- https://ofek.dev/donate/ |
|||
- https://paypal.me/ofeklev |
@ -0,0 +1,41 @@ |
|||
#!/bin/bash |
|||
set -ex |
|||
|
|||
build_dll() { |
|||
./autogen.sh |
|||
./configure --host=$1 --enable-module-recovery --enable-experimental --enable-module-ecdh --enable-benchmark=no --enable-tests=no --enable-openssl-tests=no --enable-exhaustive-tests=no --enable-static --disable-dependency-tracking --with-pic |
|||
make |
|||
} |
|||
|
|||
sudo apt-get install -y mingw-w64 |
|||
sudo apt-get -f install |
|||
|
|||
mkdir .hidden |
|||
cp * .hidden -R |
|||
mv .hidden/coincurve/_windows_libsecp256k1.py .hidden/coincurve/_libsecp256k1.py |
|||
mv .hidden ../clean |
|||
|
|||
cd .. |
|||
|
|||
curl -sLO "https://github.com/bitcoin-core/secp256k1/archive/$COINCURVE_UPSTREAM_REF.tar.gz" |
|||
tar -xzf "$COINCURVE_UPSTREAM_REF.tar.gz" |
|||
mv "secp256k1-$COINCURVE_UPSTREAM_REF" secp256k1 |
|||
|
|||
mv secp256k1 64bit |
|||
cp 64bit 32bit -R |
|||
|
|||
cd 64bit |
|||
build_dll x86_64-w64-mingw32 |
|||
mv .libs/libsecp256k1-0.dll ../clean/coincurve/libsecp256k1.dll |
|||
cd ../clean |
|||
python setup.py bdist_wheel --plat-name=win_amd64 |
|||
rm coincurve/libsecp256k1.dll |
|||
|
|||
cd ../32bit |
|||
build_dll i686-w64-mingw32 |
|||
mv .libs/libsecp256k1-0.dll ../clean/coincurve/libsecp256k1.dll |
|||
cd ../clean |
|||
python setup.py bdist_wheel --plat-name=win32 |
|||
|
|||
mv dist/* ../coincurve/dist/ |
|||
cd ../coincurve |
@ -0,0 +1,14 @@ |
|||
#!/bin/bash |
|||
set -ex |
|||
|
|||
# update brew |
|||
brew update |
|||
|
|||
# Update openssl if necessary |
|||
brew outdated openssl || brew upgrade openssl |
|||
|
|||
# Install packages needed to build lib-secp256k1 |
|||
for pkg in automake libtool pkg-config; do |
|||
brew list $pkg > /dev/null || brew install $pkg |
|||
brew outdated --quiet $pkg || brew upgrade $pkg |
|||
done |
@ -0,0 +1,9 @@ |
|||
#!/bin/bash |
|||
set -ex |
|||
|
|||
if [ "$RUNNER_OS" == "macOS" ]; then |
|||
./.github/scripts/install-macos-build-deps.sh |
|||
fi |
|||
|
|||
python -m pip install --upgrade cffi |
|||
python -m pip install --upgrade tox codecov |
@ -0,0 +1,209 @@ |
|||
name: build |
|||
|
|||
on: |
|||
push: |
|||
tags: |
|||
- v* |
|||
branches: |
|||
- master |
|||
pull_request: |
|||
branches: |
|||
- master |
|||
|
|||
concurrency: |
|||
group: build-${{ github.head_ref }} |
|||
cancel-in-progress: true |
|||
|
|||
env: |
|||
COINCURVE_UPSTREAM_REF: d8a246324650c3df8d54d133a8ac3c1b857a7a4e |
|||
COINCURVE_IGNORE_SYSTEM_LIB: '1' |
|||
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh |
|||
CIBW_ENVIRONMENT_PASS_LINUX: > |
|||
COINCURVE_UPSTREAM_REF |
|||
COINCURVE_IGNORE_SYSTEM_LIB |
|||
CIBW_TEST_COMMAND: > |
|||
python -c |
|||
"from coincurve import PrivateKey; |
|||
a=PrivateKey(); |
|||
b=PrivateKey(); |
|||
assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format()) |
|||
" |
|||
CIBW_SKIP: > |
|||
pp* |
|||
|
|||
jobs: |
|||
test: |
|||
name: Test latest Python |
|||
runs-on: ubuntu-latest |
|||
|
|||
env: |
|||
PYTHON_VERSION: '3.10' |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Set up Python ${{ env.PYTHON_VERSION }} |
|||
uses: actions/setup-python@v2 |
|||
with: |
|||
python-version: ${{ env.PYTHON_VERSION }} |
|||
|
|||
- name: Upgrade Python packaging tools |
|||
run: pip install --upgrade pip setuptools wheel |
|||
|
|||
- name: Show runner information |
|||
run: | |
|||
python --version |
|||
pip --version |
|||
|
|||
- name: Install dependencies |
|||
run: ./.github/scripts/install-test-deps.sh |
|||
|
|||
- name: Check style and typing |
|||
run: tox -e lint,typing |
|||
|
|||
- name: Run tests |
|||
run: tox -e ${PYTHON_VERSION} |
|||
|
|||
- name: Run benchmarks |
|||
run: tox -e bench |
|||
|
|||
- name: Upload coverage |
|||
run: codecov -X gcov |
|||
|
|||
linux-wheels-standard: |
|||
name: Build Linux wheels |
|||
needs: |
|||
- test |
|||
runs-on: ubuntu-20.04 |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Build wheels |
|||
uses: pypa/cibuildwheel@v2.3.1 |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: wheelhouse/*.whl |
|||
if-no-files-found: error |
|||
|
|||
macos-wheels-x86-64: |
|||
name: Build macOS wheels |
|||
needs: |
|||
- test |
|||
runs-on: macos-10.15 |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Build wheels |
|||
uses: pypa/cibuildwheel@v2.3.1 |
|||
env: |
|||
CIBW_ARCHS_MACOS: x86_64 |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: wheelhouse/*.whl |
|||
if-no-files-found: error |
|||
|
|||
macos-wheels-arm: |
|||
name: Build macOS wheels for ARM |
|||
needs: |
|||
- test |
|||
runs-on: macos-10.15 |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Build wheels |
|||
uses: pypa/cibuildwheel@v2.3.1 |
|||
env: |
|||
CIBW_ARCHS_MACOS: arm64 |
|||
COINCURVE_CROSS_HOST: aarch64-apple-darwin |
|||
CFLAGS: -target arm64-apple-macos11 |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: wheelhouse/*.whl |
|||
if-no-files-found: error |
|||
|
|||
windows-wheels-and-sdist: |
|||
name: Build Windows wheels and source distribution |
|||
needs: |
|||
- test |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Install build dependencies |
|||
run: python -m pip install --upgrade cffi |
|||
|
|||
- name: Build source distribution |
|||
run: python setup.py sdist |
|||
|
|||
- name: Build Windows wheels |
|||
run: ./.github/scripts/build-windows-wheels.sh |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: dist/* |
|||
if-no-files-found: error |
|||
|
|||
linux-wheels-arm: |
|||
name: Build Linux wheels for ARM |
|||
needs: |
|||
- test |
|||
runs-on: ubuntu-20.04 |
|||
if: > |
|||
github.event_name == 'push' |
|||
&& |
|||
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags')) |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
|
|||
- name: Set up QEMU |
|||
uses: docker/setup-qemu-action@v1 |
|||
with: |
|||
platforms: arm64 |
|||
|
|||
- name: Build wheels |
|||
uses: pypa/cibuildwheel@v2.3.1 |
|||
env: |
|||
CIBW_ARCHS_LINUX: aarch64 |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: wheelhouse/*.whl |
|||
if-no-files-found: error |
|||
|
|||
publish: |
|||
name: Publish release |
|||
needs: |
|||
- linux-wheels-standard |
|||
- macos-wheels-x86-64 |
|||
- macos-wheels-arm |
|||
- windows-wheels-and-sdist |
|||
- linux-wheels-arm |
|||
runs-on: ubuntu-latest |
|||
if: > |
|||
github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
|||
|
|||
steps: |
|||
- uses: actions/download-artifact@v2 |
|||
with: |
|||
name: artifacts |
|||
path: dist |
|||
|
|||
- name: Push build artifacts to PyPI |
|||
uses: pypa/gh-action-pypi-publish@v1.4.2 |
|||
with: |
|||
skip_existing: true |
|||
user: __token__ |
|||
password: ${{ secrets.PYPI_API_TOKEN }} |
@ -0,0 +1,62 @@ |
|||
name: docs |
|||
|
|||
on: |
|||
push: |
|||
branches: |
|||
- master |
|||
pull_request: |
|||
branches: |
|||
- master |
|||
|
|||
jobs: |
|||
build: |
|||
runs-on: ubuntu-latest |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v2 |
|||
with: |
|||
# Fetch all history for applying timestamps to every page |
|||
fetch-depth: 0 |
|||
|
|||
- name: Set up Python |
|||
uses: actions/setup-python@v2 |
|||
with: |
|||
python-version: '3.9' |
|||
|
|||
- name: Upgrade Python packaging tools |
|||
run: pip install --disable-pip-version-check --upgrade pip setuptools wheel |
|||
|
|||
- name: Install dependencies |
|||
run: python -m pip install --upgrade tox |
|||
|
|||
- name: Build documentation |
|||
run: tox -e docs-ci build |
|||
|
|||
- uses: actions/upload-artifact@v2 |
|||
with: |
|||
name: documentation |
|||
path: site |
|||
|
|||
publish: |
|||
runs-on: ubuntu-latest |
|||
|
|||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' |
|||
needs: |
|||
- build |
|||
|
|||
steps: |
|||
- uses: actions/download-artifact@v2 |
|||
with: |
|||
name: documentation |
|||
path: site |
|||
|
|||
- uses: peaceiris/actions-gh-pages@v3 |
|||
with: |
|||
github_token: ${{ secrets.GITHUB_TOKEN }} |
|||
publish_dir: ./site |
|||
commit_message: ${{ github.event.head_commit.message }} |
|||
# Write .nojekyll at the root, see: |
|||
# https://help.github.com/en/github/working-with-github-pages/about-github-pages#static-site-generators |
|||
enable_jekyll: false |
|||
# Only deploy if there were changes |
|||
allow_empty_commit: false |
@ -1,104 +0,0 @@ |
|||
sudo: true |
|||
dist: xenial |
|||
language: python |
|||
|
|||
cache: |
|||
directories: |
|||
- $HOME/.cache/pip |
|||
|
|||
# Only build master, release branches, and version tags (which are considered |
|||
# branches by Travis, see https://github.com/travis-ci/travis-ci/issues/8518) |
|||
branches: |
|||
only: |
|||
- master |
|||
- /^release.+$/ |
|||
- /^[0-9]+\.[0-9]+\.[0-9]+.*$/ |
|||
|
|||
env: |
|||
global: |
|||
- LD_LIBRARY_PATH=./libsecp256k1_ext/.libs |
|||
- DYLD_FALLBACK_LIBRARY_PATH=./libsecp256k1_ext/.libs |
|||
- LIB_DIR=./libsecp256k1_ext/.libs |
|||
- INCLUDE_DIR=./libsecp256k1_ext/include |
|||
- PYPI_USERNAME=Ofekmeister |
|||
|
|||
addons: |
|||
apt: |
|||
packages: |
|||
- autoconf |
|||
- automake |
|||
- git |
|||
- libffi-dev |
|||
- libgmp-dev |
|||
- libtool |
|||
- pkg-config |
|||
|
|||
matrix: |
|||
include: |
|||
- python: 3.6 |
|||
env: TOXENV=style BUILD_LINUX_WHEELS=1 |
|||
services: docker |
|||
- python: 2.7 |
|||
env: TOXENV=py27,bench |
|||
- python: 3.5 |
|||
env: TOXENV=py35,bench |
|||
- python: 3.6 |
|||
env: TOXENV=py36,bench |
|||
- python: 3.7 |
|||
env: TOXENV=py37,bench |
|||
- python: 3.8 |
|||
env: TOXENV=py38,bench |
|||
- python: pypy3 |
|||
env: TOXENV=pypy3k,bench |
|||
- os: osx |
|||
language: generic |
|||
python: 2.7 |
|||
osx_image: xcode10.1 |
|||
env: TOXENV=py27,bench TRAVIS_PYTHON_VERSION=2.7 |
|||
- os: osx |
|||
language: generic |
|||
python: 3.5 |
|||
osx_image: xcode10.1 |
|||
env: TOXENV=py35,bench TRAVIS_PYTHON_VERSION=3.5 |
|||
- os: osx |
|||
language: generic |
|||
python: 3.6 |
|||
osx_image: xcode10.1 |
|||
env: TOXENV=py36,bench TRAVIS_PYTHON_VERSION=3.6 NEED_SSL_FIX=true |
|||
- os: osx |
|||
language: generic |
|||
python: 3.7 |
|||
osx_image: xcode10.1 |
|||
env: TOXENV=py37,bench TRAVIS_PYTHON_VERSION=3.7 |
|||
- os: osx |
|||
language: generic |
|||
python: 3.8 |
|||
osx_image: xcode10.1 |
|||
env: TOXENV=py38,bench TRAVIS_PYTHON_VERSION=3.8 |
|||
|
|||
before_install: |
|||
- chmod +x .travis/build-linux-wheels.sh |
|||
- chmod +x .travis/build_windows_wheels.sh |
|||
- chmod +x .travis/deploy.sh |
|||
- chmod +x .travis/prepare_windows_build.sh |
|||
- chmod +x .travis/upload_coverage.sh |
|||
|
|||
install: |
|||
- .travis/prepare_windows_build.sh |
|||
- source .travis/install.sh |
|||
|
|||
script: |
|||
# Reuse test environments for benchmarks |
|||
- export TESTENV=$(python -c "import os;print(os.getenv('TOXENV', 'bench').split(',')[0])") |
|||
- tox |
|||
|
|||
after_success: |
|||
- .travis/upload_coverage.sh |
|||
|
|||
deploy: |
|||
- provider: script |
|||
skip_cleanup: true |
|||
script: .travis/deploy.sh |
|||
on: |
|||
repo: ofek/coincurve |
|||
tags: true |
@ -1,34 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
set -e |
|||
set -x |
|||
|
|||
# Install a system package required by our library |
|||
yum install -y pkg-config libffi libffi-devel |
|||
|
|||
# Use updated GMP |
|||
curl -O https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2 && tar -xjpf gmp-*.tar.bz2 && cd gmp* && ./configure --build=${BUILD_GMP_CPU}-pc-linux-gnu > /dev/null && make > /dev/null && make check > /dev/null && make install > /dev/null && cd .. |
|||
|
|||
mkdir out |
|||
|
|||
# PyPy |
|||
if [[ "$PLAT" == "manylinux2010_x86_64" ]]; then |
|||
mkdir /opt/python/pypy3 |
|||
curl -LO https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.6-7.1.1-beta-linux_x86_64-portable.tar.bz2 |
|||
tar -xjpf pypy3.6-7.1.1-beta-linux_x86_64-portable.tar.bz2 -C /opt/python/pypy3 --strip-components=1 |
|||
curl -sSL https://raw.githubusercontent.com/pypa/get-pip/master/get-pip.py | /opt/python/pypy3/bin/pypy |
|||
fi |
|||
|
|||
# Compile wheels |
|||
for PYBIN in /opt/python/*/bin; do |
|||
if [[ ${PYBIN} =~ (cp27|cp35|cp36|cp37|cp38|pypy) ]]; then |
|||
${PYBIN}/pip wheel /io/ -w wheelhouse/ |
|||
fi |
|||
done |
|||
|
|||
# Adjust wheel tags |
|||
for whl in wheelhouse/coincurve*.whl; do |
|||
auditwheel repair "$whl" --plat $PLAT -w out |
|||
done |
|||
|
|||
cp out/*.whl /io/dist |
@ -1,51 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
set -e -x |
|||
|
|||
echo "deploy" |
|||
|
|||
python setup.py install |
|||
|
|||
# remove any left over files from previous steps |
|||
rm -rf build dist |
|||
mkdir dist |
|||
|
|||
python setup.py sdist |
|||
|
|||
if [[ "$TRAVIS_OS_NAME" == "linux" && ${BUILD_LINUX_WHEELS} -eq 1 ]]; then |
|||
docker run --rm -e PLAT="manylinux2010_x86_64" -e BUILD_GMP_CPU="amd64" -v $(pwd):/io quay.io/pypa/manylinux2010_x86_64 /io/.travis/build-linux-wheels.sh |
|||
docker run --rm -e PLAT="manylinux1_x86_64" -e BUILD_GMP_CPU="amd64" -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /io/.travis/build-linux-wheels.sh |
|||
linux32 docker run --rm -e PLAT="manylinux1_i686" -e BUILD_GMP_CPU="i686" -v $(pwd):/io quay.io/pypa/manylinux1_i686 /io/.travis/build-linux-wheels.sh |
|||
.travis/build_windows_wheels.sh |
|||
else |
|||
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then |
|||
# Make sure we can build and "fix" the wheel. |
|||
python -m pip install delocate wheel |
|||
# Create directories for the built and fixed wheels. |
|||
mkdir dist_wheels/ fixed_wheels/ |
|||
# Build the wheel for the local OS. |
|||
python -m pip wheel . --wheel-dir dist_wheels/ |
|||
# Make the wheel relocatable to another OS. |
|||
delocate-wheel \ |
|||
--check-archs \ |
|||
--wheel-dir fixed_wheels/ \ |
|||
--verbose \ |
|||
dist_wheels/coincurve*.whl |
|||
# Move the fixed wheel into dist/. |
|||
[ -d dist/ ] || mkdir dist/ |
|||
mv fixed_wheels/coincurve*.whl dist/ |
|||
# Clean up build directories. |
|||
rm -fr dist_wheels/ fixed_wheels/ |
|||
fi |
|||
fi |
|||
|
|||
ls -l dist |
|||
|
|||
python -m pip install twine |
|||
|
|||
# Ignore non-existing files in globs |
|||
shopt -s nullglob |
|||
|
|||
twine upload --skip-existing dist/coincurve*.{whl,gz} -u "${PYPI_USERNAME}" |
|||
|
|||
set +e +x |
@ -1,91 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
set -e |
|||
set -x |
|||
|
|||
# On osx we need to bring our own Python. |
|||
# See: https://github.com/travis-ci/travis-ci/issues/2312 |
|||
if [[ $TRAVIS_OS_NAME == "osx" ]]; then |
|||
|
|||
# We use the official python.org installers to make sure our wheels are |
|||
# going to be as widely compatible as possible |
|||
PYTHON_PKG_27="https://www.python.org/ftp/python/2.7.16/python-2.7.16-macosx10.9.pkg" |
|||
PYTHON_PKG_36="https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg" |
|||
PYTHON_PKG_37="https://www.python.org/ftp/python/3.7.3/python-3.7.3-macosx10.9.pkg" |
|||
PYTHON_PKG_38="https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg" |
|||
GET_PIP="https://bootstrap.pypa.io/get-pip.py" |
|||
|
|||
# update brew |
|||
brew update || brew update |
|||
|
|||
# Update openssl if necessary |
|||
brew outdated openssl || brew upgrade openssl |
|||
|
|||
# Install packages needed to build lib-secp256k1 |
|||
for pkg in automake libtool pkg-config libffi; do |
|||
brew list $pkg > /dev/null || brew install $pkg |
|||
brew outdated --quiet $pkg || brew upgrade $pkg |
|||
done |
|||
|
|||
mkdir -p ~/.cache/python-dl |
|||
|
|||
if [[ "${TRAVIS_PYTHON_VERSION}" == "3.5" ]]; then |
|||
PYVERSION="${TRAVIS_PYTHON_VERSION}.5" |
|||
brew outdated pyenv || brew upgrade pyenv |
|||
pyenv install ${PYVERSION} |
|||
pyenv global ${PYVERSION} |
|||
else |
|||
builtin pushd ~/.cache/python-dl |
|||
ls -l |
|||
|
|||
py_pkg=PYTHON_PKG_${TRAVIS_PYTHON_VERSION//./} |
|||
py_pkg=${!py_pkg} |
|||
|
|||
installer_pkg=$(basename ${py_pkg}) |
|||
|
|||
# The package might have been cached from a previous run |
|||
if [[ ! -f ${installer_pkg} ]]; then |
|||
curl -LO ${py_pkg} |
|||
fi |
|||
|
|||
sudo installer -pkg ${installer_pkg} -target / |
|||
builtin popd |
|||
fi |
|||
|
|||
case "${TRAVIS_PYTHON_VERSION}" in |
|||
2.7) |
|||
python=/Library/Frameworks/Python.framework/Versions/${TRAVIS_PYTHON_VERSION}/bin/python |
|||
virtualenv=virtualenv |
|||
;; |
|||
3.6|3.7|3.8) |
|||
python=/Library/Frameworks/Python.framework/Versions/${TRAVIS_PYTHON_VERSION}/bin/python3 |
|||
virtualenv=venv |
|||
;; |
|||
3.5) |
|||
python="$(pyenv root)/versions/${PYVERSION}/bin/python" |
|||
virtualenv=venv |
|||
;; |
|||
esac |
|||
|
|||
if [[ "${TRAVIS_PYTHON_VERSION}" == "2.7" ]]; then |
|||
builtin pushd ~ |
|||
curl -LO ${GET_PIP} |
|||
${python} get-pip.py |
|||
${python} -m pip install --user virtualenv |
|||
builtin popd |
|||
fi |
|||
|
|||
# https://bugs.python.org/issue28150 |
|||
if [[ "${NEED_SSL_FIX}" == "true" ]]; then |
|||
"/Applications/Python ${TRAVIS_PYTHON_VERSION}/Install Certificates.command" |
|||
fi |
|||
|
|||
mkdir ~/virtualenv |
|||
${python} -m ${virtualenv} ~/virtualenv/python${TRAVIS_PYTHON_VERSION} |
|||
source ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/activate |
|||
fi |
|||
|
|||
# Install necessary packages |
|||
python -m pip install -U cffi tox codecov |
|||
|
|||
set +x +e |
@ -1,11 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
if [[ "$TRAVIS_OS_NAME" == "linux" && ${BUILD_LINUX_WHEELS} -eq 1 ]]; then |
|||
mkdir .hidden |
|||
cp * .hidden -R |
|||
mkdir .hidden/dist |
|||
mv .hidden/coincurve/_windows_libsecp256k1.py .hidden/coincurve/_libsecp256k1.py |
|||
mv .hidden ../clean |
|||
sudo apt-get install -y mingw-w64 |
|||
sudo apt-get -f install |
|||
fi |
@ -1,14 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
set -e |
|||
set -x |
|||
|
|||
if [ -n "${TOXENV}" ]; then |
|||
case "${TOXENV}" in |
|||
style);; |
|||
^bench$);; |
|||
*) |
|||
codecov -X gcov |
|||
;; |
|||
esac |
|||
fi |
@ -1,50 +0,0 @@ |
|||
Users |
|||
----- |
|||
|
|||
- `AnyLedger <https://github.com/AnyLedger/anyledger-backend/blob/cb9e277ef4ba775384a1eb80ff1577418f88684e/requirements.in#L5>`_ |
|||
- `Ark Ecosystem <https://github.com/ArkEcosystem/python-crypto/blob/a7c739c070ce17f8aa64155b95b698e7465ab373/setup.py#L9>`_ |
|||
- `Augur Project <https://github.com/AugurProject/augur/blob/95177dfaee7d978608543523f180609c582c1ff9/packages/augur-core/requirements.txt#L9>`_ |
|||
- `bit <https://github.com/ofek/bit>`_ |
|||
- `Blockcerts <https://github.com/blockchain-certificates/cert-issuer/blob/b8f7af75c403f62e8dc1e50bd139d8ed2dc00742/ethereum_requirements.txt#L1>`_ |
|||
- `btcrecover <https://github.com/gurnec/btcrecover/commit/f113867fa22d2f5b22175cc2b5b3892351bc1109>`_ |
|||
- `Confidential Consortium Framework <https://github.com/microsoft/CCF/pull/213>`_ |
|||
- `crankycoin <https://github.com/cranklin/crankycoin/blob/3d2b3482698227397a8daf30e0b80b2f2c030aec/requirements.txt#L8>`_ |
|||
- `ecies/py <https://github.com/ecies/py/blob/8a2144ade9b61d0f47d32933a4480b8ad7332aec/requirements.txt#L3>`_ |
|||
- `ElementsProject <https://github.com/ElementsProject/lightning/pull/2803>`_ |
|||
- `Enigma <https://github.com/enigmampc/surface/blob/40ca2056bce32d0d479e4809ac8cd5ded102b3f0/etc/requirements.txt#L8>`_ |
|||
- `ethereum/eth-keys <https://github.com/ethereum/eth-keys/commit/81755dfda714d77c1f8a092810ca31e570d84425>`_ |
|||
- `ethereum/eth-tester <https://github.com/ethereum/eth-tester/blob/96e4e69de46acca387f2a946920e4c3e3f35605f/tox.ini#L17>`_ |
|||
- `ethereum/py-evm <https://github.com/ethereum/py-evm/pull/31>`_ |
|||
- `ethereum/pydevp2p <https://github.com/ethereum/pydevp2p/pull/80>`_ |
|||
- `ethereum/pyethereum <https://github.com/ethereum/pyethereum/pull/777>`_ |
|||
- `ethereum/trinity <https://github.com/ethereum/trinity/blob/07d9692a36663c69b6f00331654501b4d928b001/setup.py#L33>`_ |
|||
- `ethereum/vyper <https://github.com/ethereum/vyper/blob/9491bcde0f87fd04d19d0a40a6c901b1bc0a718b/Dockerfile#L15>`_ |
|||
- `EtherollApp <https://github.com/AndreMiras/EtherollApp/commit/2966c0850156364e46412da2331cee146b490e57>`_ |
|||
- `ForkDelta <https://github.com/forkdelta/backend-replacement/blob/45517f48579f3270dc47da2075d8e0efc2e9ecb8/requirements.txt#L46>`_ |
|||
- `golemfactory/golem <https://github.com/golemfactory/golem/pull/1527>`_ |
|||
- `golemfactory/golem-messages <https://github.com/golemfactory/golem-messages/blob/1f72b6a6757036218cdf471c0295b8895b963266/setup.py#L39>`_ |
|||
- `Heimdall <https://github.com/maddevsio/heimdall/blob/40248cd7e3ca6d0a39e3d71388792fc557ebc5ec/requirements.txt#L14>`_ |
|||
- `HoneyBadgerBFT <https://github.com/initc3/HoneyBadgerBFT-Python/blob/048d6afb3c7184db670b96119aa99a6a5b0dafa6/setup.py#L31>`_ |
|||
- `ICON Foundation <https://github.com/icon-project/icon-sdk-python/pull/48>`_ |
|||
- `JoinMarket <https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/223>`_ |
|||
- `lbryio/lbry <https://github.com/lbryio/lbry/blob/d64916a06115920aaa9eaab67704a0b2d34aae20/CHANGELOG.md#security-1>`_ |
|||
- `lbryio/torba <https://github.com/lbryio/torba/pull/13>`_ |
|||
- `libp2p <https://github.com/libp2p/py-libp2p/pull/240>`_ |
|||
- `minichain <https://github.com/kigawas/minichain/blob/8c1fd9499954bcdbc7e0f77f6fa6d9af3328f64c/requirements.txt#L3>`_ |
|||
- `Nekoyume <https://github.com/nekoyume/nekoyume/pull/67>`_ |
|||
- `NuCypher <https://github.com/nucypher/nucypher/pull/592>`_ |
|||
- `Ocean Protocol <https://github.com/oceanprotocol/squid-py/blob/45e1ceada45934a593022ca96bec552e8beb6051/Pipfile#L14>`_ |
|||
- `OmiseGO <https://github.com/omisego/fee-burner/blob/984f75362ca193680ecb4dc43c7d2e13f3be68bd/contracts/requirements.txt#L9>`_ |
|||
- `PeerAssets <https://github.com/PeerAssets/pypeerassets/commit/113c9a234c94499c7e591b8a93928be0a77298fa>`_ |
|||
- `Planetarium <https://github.com/planetarium/coincurve-stubs>`_ |
|||
- `python-idex <https://github.com/sammchardy/python-idex/blob/3b698533e290a0fe884961ce69c4b2e699378b8d/requirements.txt#L2>`_ |
|||
- `PyWallet <https://github.com/AndreMiras/PyWallet/commit/69f2f240b39f332123d347c72bc75f0b199813c1>`_ |
|||
- `Quantstamp <https://github.com/quantstamp/qsp-protocol-node/blob/6abadfeef4c80d8a246e3676ed7238e290edf050/requirements.txt#L32>`_ |
|||
- `QuarkChain <https://github.com/QuarkChain/pyquarkchain/blob/4c002d4b535174704ce39f3954e4026f23d520bb/requirements.txt#L4>`_ |
|||
- `raiden-network/microraiden <https://github.com/raiden-network/microraiden/blob/8d5f1d86818f01c8cafe9366da1cecdef0e8b0f4/requirements.txt#L5>`_ |
|||
- `raiden-network/raiden <https://github.com/raiden-network/raiden/pull/534>`_ |
|||
- `raiden-network/raiden-contracts <https://github.com/raiden-network/raiden-contracts/blob/f251c01015564a2b91401692234aa5ed1ea67ebc/requirements.txt#L3>`_ |
|||
- `raiden-network/raiden-libs <https://github.com/raiden-network/raiden-libs/blob/e88586e6d40e2b49d19efbdffafdaa2a86f84c86/requirements.txt#L1>`_ |
|||
- `raiden-network/raiden-services <https://github.com/raiden-network/raiden-services/blob/cf69ebc29bfcdf946d6429bc9c1bb63779a19599/requirements.txt#L9>`_ |
|||
- `Rotkehlchen <https://github.com/rotkehlchenio/rotkehlchen/blob/599bd9c1a780940926b4baabcd4164368b75a120/requirements.txt#L8>`_ |
|||
- `ZeroNet <https://github.com/HelloZeroNet/ZeroNet/blob/fa7013fdf7eeb7bb01c1c113b4529b7233bf52ce/requirements.txt#L11>`_ |
@ -1,116 +0,0 @@ |
|||
History |
|||
------- |
|||
|
|||
Important changes are emphasized. |
|||
|
|||
master |
|||
^^^^^^ |
|||
|
|||
13.0.0 |
|||
^^^^^^ |
|||
|
|||
- **New:** Binary wheels for Python 3.8! |
|||
- Support building on OpenBSD |
|||
- Improve handling of PEM private key deserialization |
|||
- Improve ECDH documentation |
|||
- Improvements from libsecp256k1 master |
|||
|
|||
12.0.0 |
|||
^^^^^^ |
|||
|
|||
- **New:** Binary wheels on Linux for PyPy3.6 v7.1.1-beta! |
|||
- **New:** Binary wheels on macOS for Python 3.8.0-alpha.3! |
|||
- **New:** Binary wheels on Linux are now also built with the new `manylinux2010 <https://www.python.org/dev/peps/pep-0571>`_ spec for 64-bit platforms! |
|||
- Improvements from libsecp256k1 master |
|||
|
|||
11.0.0 |
|||
^^^^^^ |
|||
|
|||
- Fix some linking scenarios by placing bundled libsecp256k1 dir first in path |
|||
- Allow override of system libsecp256k1 with environment variable |
|||
- Add benchmarks |
|||
- Use Codecov to track coverage |
|||
- Use black for code formatting |
|||
|
|||
10.0.0 |
|||
^^^^^^ |
|||
|
|||
- Support tox for testing |
|||
- Compatibility with latest libsecp256k1 ECDH API |
|||
- Make libgmp optional when building from source |
|||
|
|||
9.0.0 |
|||
^^^^^ |
|||
|
|||
- Fixed wheels for macOS |
|||
- **Breaking:** Drop support for 32-bit macOS |
|||
|
|||
8.0.2 |
|||
^^^^^ |
|||
|
|||
- No longer package tests |
|||
|
|||
8.0.0 |
|||
^^^^^ |
|||
|
|||
- **New:** Binary wheels for Python 3.7! |
|||
- **Changed:** Binary wheels on macOS for Python 3.5 now use Homebrew |
|||
Python for compilation due to new security requirements |
|||
- Make build system support new GitHub & PyPI security requirements |
|||
- Improvements from libsecp256k1 master |
|||
|
|||
7.1.0 |
|||
^^^^^ |
|||
|
|||
- Pin version of libsecp256k1 |
|||
- Improve docs |
|||
|
|||
7.0.0 |
|||
^^^^^ |
|||
|
|||
- Improvements from libsecp256k1 master |
|||
- Fix build script |
|||
|
|||
6.0.0 |
|||
^^^^^ |
|||
|
|||
- Resolved `#6 <https://github.com/ofek/coincurve/issues/6>`_. You can choose |
|||
to use this or remain on 5.2.0. This will only be a temporary change. See |
|||
`<https://github.com/ofek/coincurve/commit/3e93480b3e38c6b9beb0bc2de83bc3630fc74c46>`_ |
|||
|
|||
5.2.0 |
|||
^^^^^ |
|||
|
|||
- Added support for supplying a custom nonce to ``PrivateKey.sign``. |
|||
|
|||
5.1.0 |
|||
^^^^^ |
|||
|
|||
- Added ``PublicKey.combine_keys`` class method. |
|||
- Improvements to documentation. |
|||
|
|||
5.0.1 |
|||
^^^^^ |
|||
|
|||
- Fixed an issue where ``validate_secret`` would occasionally erroneously error |
|||
on user-provided secrets (secrets not generated by Coincurve itself) if there |
|||
were not exactly 256 bits of entropy. See |
|||
`#5 <https://github.com/ofek/coincurve/issues/5>`_ |
|||
|
|||
5.0.0 |
|||
^^^^^ |
|||
|
|||
- **Breaking:** Coincurve is now dual-licensed under the terms of MIT and Apache v2.0. |
|||
- Performance improvements from libsecp256k1 master: |
|||
`1 <https://github.com/bitcoin-core/secp256k1/commit/cf12fa13cb96797d6ce356a5023051f99f915fe6>`_ |
|||
`2 <https://github.com/bitcoin-core/secp256k1/commit/aa8499080e2a657113781921096b59a74d7bc0e7>`_ |
|||
`3 <https://github.com/bitcoin-core/secp256k1/commit/8b7680a826498a786eca5737e0e97ee4d2e63713>`_ |
|||
`4 <https://github.com/bitcoin-core/secp256k1/commit/465159c278cecc2cf8d934e78f640f345243eb72>`_ |
|||
`5 <https://github.com/bitcoin-core/secp256k1/commit/4cc8f52505b2922390a115c77eeb3b251bc9af88>`_ |
|||
`6 <https://github.com/bitcoin-core/secp256k1/commit/cbc20b8c34d44c2ef175420f3cdfe054f82e8e2c>`_ |
|||
- Improvements to documentation. |
|||
|
|||
4.5.1 |
|||
^^^^^ |
|||
|
|||
- First public stable release |
@ -1,3 +1,4 @@ |
|||
include coincurve/py.typed |
|||
include setup_support.py |
|||
recursive-include _cffi_build *.py *.h |
|||
graft libsecp256k1 |
|||
|
@ -0,0 +1,31 @@ |
|||
# coincurve |
|||
|
|||
| | | |
|||
| --- | --- | |
|||
| CI/CD | [![CI - Test](https://github.com/ofek/coincurve/actions/workflows/build.yml/badge.svg)](https://github.com/ofek/coincurve/actions/workflows/build.yml) [![CI - Coverage](https://img.shields.io/codecov/c/github/ofek/coincurve/master.svg?logo=codecov&logoColor=red)](https://codecov.io/github/ofek/coincurve) | |
|||
| Docs | [![CI - Docs](https://github.com/ofek/coincurve/actions/workflows/docs.yml/badge.svg)](https://github.com/ofek/coincurve/actions/workflows/docs.yml) | |
|||
| Package | [![PyPI - Version](https://img.shields.io/pypi/v/coincurve.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/coincurve/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/coincurve.svg?color=blue&label=Downloads&logo=pypi&logoColor=gold)](https://pypi.org/project/coincurve/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/coincurve.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/coincurve/) | |
|||
| Meta | [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/ambv/black) [![imports - isort](https://img.shields.io/badge/imports-isort-ef8336.svg)](https://github.com/pycqa/isort) [![License - MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-9400d3.svg)](https://spdx.org/licenses/) [![GitHub Sponsors](https://img.shields.io/github/sponsors/ofek?logo=GitHub%20Sponsors&style=social)](https://github.com/sponsors/ofek) | |
|||
|
|||
----- |
|||
|
|||
This library provides well-tested Python bindings for [libsecp256k1](https://github.com/bitcoin-core/secp256k1), the heavily optimized C library |
|||
used by [Bitcoin Core](https://github.com/bitcoin/bitcoin) for operations on the elliptic curve [secp256k1](https://en.bitcoin.it/wiki/Secp256k1). |
|||
|
|||
Feel free to read the [documentation](https://ofek.dev/coincurve/)! |
|||
|
|||
## Users |
|||
|
|||
- [Ethereum](https://ethereum.org) |
|||
- [LBRY](https://lbry.com) |
|||
- [ZeroNet](https://zeronet.io) |
|||
- [libp2p](https://libp2p.io) |
|||
|
|||
and [many more](https://ofek.dev/coincurve/users/)! |
|||
|
|||
## License |
|||
|
|||
`coincurve` is distributed under the terms of any of the following licenses: |
|||
|
|||
- [MIT](https://spdx.org/licenses/MIT.html) |
|||
- [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) |
@ -1,349 +0,0 @@ |
|||
Coincurve |
|||
========= |
|||
|
|||
.. image:: https://travis-ci.org/ofek/coincurve.svg?branch=master |
|||
:target: https://travis-ci.org/ofek/coincurve |
|||
:alt: Travis CI |
|||
|
|||
.. image:: https://codecov.io/github/ofek/coincurve/coverage.svg?branch=master |
|||
:target: https://codecov.io/github/ofek/coincurve?branch=master |
|||
:alt: Codecov |
|||
|
|||
.. image:: https://img.shields.io/pypi/status/coverage.svg |
|||
:target: https://pypi.org/project/coincurve |
|||
:alt: PyPI - Status |
|||
|
|||
.. image:: https://img.shields.io/pypi/v/coincurve.svg |
|||
:target: https://pypi.org/project/coincurve |
|||
:alt: PyPI - Version |
|||
|
|||
.. image:: https://pepy.tech/badge/coincurve |
|||
:target: https://pepy.tech/project/coincurve |
|||
:alt: PyPI - Downloads |
|||
|
|||
.. image:: https://img.shields.io/badge/license-MIT%2FApache--2.0-9400d3.svg |
|||
:target: https://choosealicense.com/licenses |
|||
:alt: License: MIT/Apache-2.0 |
|||
|
|||
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg |
|||
:target: https://github.com/ambv/black |
|||
:alt: Code style: black |
|||
|
|||
----- |
|||
|
|||
This library provides well-tested Python CFFI bindings for |
|||
`libsecp256k1 <https://github.com/bitcoin-core/secp256k1>`_, the heavily |
|||
optimized C library used by `Bitcoin Core <https://github.com/bitcoin/bitcoin>`_ |
|||
for operations on elliptic curve secp256k1. |
|||
|
|||
Table of Contents |
|||
~~~~~~~~~~~~~~~~~ |
|||
|
|||
.. contents:: |
|||
:backlinks: top |
|||
:local: |
|||
|
|||
Features |
|||
-------- |
|||
|
|||
- Fastest available implementation (more than 10x faster than OpenSSL) |
|||
- Clean, easy to use API |
|||
- Frequent updates from `libsecp256k1 <https://github.com/bitcoin-core/secp256k1>`_ master |
|||
- Linux, macOS, and Windows all have binary packages for both 64 and 32-bit architectures |
|||
- Linux & macOS use GMP for faster computation |
|||
- Deterministic signatures via `RFC 6979 <https://tools.ietf.org/html/rfc6979>`_ |
|||
- Non-malleable signatures (lower-S form) by default |
|||
- Secure, non-malleable `ECDH implementation <https://github.com/ofek/coincurve/issues/9#issuecomment-329235214>`_ |
|||
- Implements a fix for `<https://bugs.python.org/issue28150>`_ to support Python 3.6+ on macOS |
|||
|
|||
Users |
|||
----- |
|||
|
|||
- `<https://www.ethereum.org>`_ |
|||
- `<https://lbry.io>`_ |
|||
- `<https://libp2p.io>`_ |
|||
- `<https://zeronet.io>`_ |
|||
- `<https://ark.io>`_ |
|||
- `<https://www.augur.net>`_ |
|||
- `<https://www.nucypher.com>`_ |
|||
- `<https://raiden.network>`_ |
|||
- `<https://golem.network>`_ |
|||
- `<https://omisego.network>`_ |
|||
|
|||
and `many more <https://github.com/ofek/coincurve/blob/master/DOWNSTREAM.rst>`_ |
|||
|
|||
Installation |
|||
------------ |
|||
|
|||
Coincurve is distributed on PyPI and is available on Linux/macOS and Windows and |
|||
supports Python 2.7/3.5+ and PyPy3.5-v5.8.1+. |
|||
|
|||
.. code-block:: bash |
|||
|
|||
$ pip install coincurve |
|||
|
|||
If you are on a system that doesn't have a precompiled binary wheel (e.g. FreeBSD) |
|||
then pip will fetch source to build yourself. You must have the necessary packages. |
|||
|
|||
On Debian/Ubuntu the necessary system packages are: |
|||
|
|||
- ``build-essential`` |
|||
- ``automake`` |
|||
- ``pkg-config`` |
|||
- ``libtool`` |
|||
- ``libffi-dev`` |
|||
- ``python3-dev`` (or ``python-dev`` for Python 2) |
|||
- ``libgmp-dev`` (optional) |
|||
|
|||
On macOS the necessary Homebrew packages are: |
|||
|
|||
- ``automake`` |
|||
- ``pkg-config`` |
|||
- ``libtool`` |
|||
- ``libffi`` |
|||
- ``gmp`` (optional) |
|||
|
|||
API |
|||
--- |
|||
|
|||
Coincurve provides a simple API. |
|||
|
|||
coincurve.verify_signature |
|||
^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|||
|
|||
``verify_signature(signature, message, public_key, hasher=sha256, context=GLOBAL_CONTEXT)`` |
|||
|
|||
Verifies some message was signed by the owner of a public key. |
|||
|
|||
* Parameters: |
|||
|
|||
- **signature** (``bytes``) - The signature to verify. |
|||
- **message** (``bytes``) - The message that was supposedly signed. |
|||
- **public_key** (``bytes``) - A public key in compressed or uncompressed form. |
|||
- **hasher** - The hash function to use, can be ``None``. hasher(message) must return 32 bytes. |
|||
- **context** (``coincurve.Context``) |
|||
|
|||
* Returns: ``bool`` |
|||
|
|||
coincurve.PrivateKey |
|||
^^^^^^^^^^^^^^^^^^^^ |
|||
|
|||
All instances have a ``public_key`` of type ``coincurve.PublicKey`` |
|||
|
|||
``PrivateKey(secret=None, context=GLOBAL_CONTEXT)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **secret** (``bytes``) - The secret to use. |
|||
- **context** (``coincurve.Context``) |
|||
|
|||
**Methods:** |
|||
|
|||
*classmethod* ``from_hex(hexed, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_int(num, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_pem(pem, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_der(der, context=GLOBAL_CONTEXT)`` |
|||
|
|||
``sign(message, hasher=sha256, custom_nonce=None)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **message** (``bytes``) - The message to sign. |
|||
- **hasher** - The hash function to use, can be ``None``. hasher(message) must return 32 bytes. |
|||
- **custom_nonce** - A tuple of arity 2 in the form of ``(nonce_fn, nonce_data)``. Refer to: |
|||
`secp256k1.h <https://github.com/bitcoin-core/secp256k1/blob/b8c26a39903de7bf1d789232e030319116b011ac/include/secp256k1.h#L449-L450>`_ |
|||
|
|||
* Returns: ``bytes``. 68 <= len(signature) <= 71 |
|||
|
|||
``sign_recoverable(message, hasher=sha256)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **message** (``bytes``) - The message to sign. |
|||
- **hasher** - The hash function to use, can be ``None``. hasher(message) must return 32 bytes. |
|||
|
|||
* Returns: ``bytes`` |
|||
|
|||
``ecdh(public_key)`` |
|||
|
|||
Computes a Diffie-Hellman secret in constant time. **Note:** This prevents malleability by returning |
|||
``sha256(compressed_public_key)`` instead of the ``x`` coordinate directly. See `<https://github.com/ofek/coincurve/issues/9>`_. |
|||
|
|||
* Parameters: |
|||
|
|||
- **public_key** (``bytes``) - Another party's public key in compressed or uncompressed form. |
|||
|
|||
* Returns: ``bytes`` |
|||
|
|||
``add(scalar, update=False)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **scalar** (``bytes``) - The scalar to add. |
|||
- **update** (``bool``) - If ``True``, will update and return ``self``. |
|||
|
|||
* Returns: ``coincurve.PrivateKey`` |
|||
|
|||
``multiply(scalar, update=False)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **scalar** (``bytes``) - The scalar to multiply. |
|||
- **update** (``bool``) - If ``True``, will update and return ``self``. |
|||
|
|||
* Returns: ``coincurve.PrivateKey`` |
|||
|
|||
``to_hex()`` |
|||
|
|||
``to_int()`` |
|||
|
|||
``to_pem()`` |
|||
|
|||
``to_der()`` |
|||
|
|||
coincurve.PublicKey |
|||
^^^^^^^^^^^^^^^^^^^ |
|||
|
|||
``PublicKey(data, context=GLOBAL_CONTEXT)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **data** (``bytes``) - The public key in compressed or uncompressed form. |
|||
- **context** (``coincurve.Context``) |
|||
|
|||
**Methods:** |
|||
|
|||
*classmethod* ``from_secret(secret, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_valid_secret(secret, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_point(x, y, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``from_signature_and_message(serialized_sig, message, hasher=sha256, context=GLOBAL_CONTEXT)`` |
|||
|
|||
*classmethod* ``combine_keys(public_keys, context=GLOBAL_CONTEXT)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **public_keys** (``list``) - A ``list`` of ``coincurve.PublicKey`` to add. |
|||
- **context** (``coincurve.Context``) |
|||
|
|||
* Returns: ``coincurve.PublicKey`` |
|||
|
|||
``format(compressed=True)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **compressed** (``bool``) |
|||
|
|||
* Returns: The public key serialized to ``bytes``. |
|||
|
|||
``point()`` |
|||
|
|||
* Returns: (x, y) |
|||
|
|||
``verify(signature, message, hasher=sha256)`` |
|||
|
|||
Verifies some message was signed by the owner of this public key. |
|||
|
|||
* Parameters: |
|||
|
|||
- **signature** (``bytes``) - The signature to verify. |
|||
- **message** (``bytes``) - The message that was supposedly signed. |
|||
- **hasher** - The hash function to use, can be ``None``. hasher(message) must return 32 bytes. |
|||
|
|||
* Returns: ``bool`` |
|||
|
|||
``add(scalar, update=False)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **scalar** (``bytes``) - The scalar to add. |
|||
- **update** (``bool``) - If ``True``, will update and return ``self``. |
|||
|
|||
* Returns: ``coincurve.PublicKey`` |
|||
|
|||
``multiply(scalar, update=False)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **scalar** (``bytes``) - The scalar to multiply. |
|||
- **update** (``bool``) - If ``True``, will update and return ``self``. |
|||
|
|||
* Returns: ``coincurve.PublicKey`` |
|||
|
|||
``combine(public_keys, update=False)`` |
|||
|
|||
* Parameters: |
|||
|
|||
- **public_keys** (``list``) - A ``list`` of ``coincurve.PublicKey`` to add. |
|||
- **update** (``bool``) - If ``True``, will update and return ``self``. |
|||
|
|||
* Returns: ``coincurve.PublicKey`` |
|||
|
|||
License |
|||
------- |
|||
|
|||
Coincurve is distributed under the terms of both |
|||
|
|||
- `Apache License, Version 2.0 <https://choosealicense.com/licenses/apache-2.0>`_ |
|||
- `MIT License <https://choosealicense.com/licenses/mit>`_ |
|||
|
|||
at your option. |
|||
|
|||
Credits |
|||
------- |
|||
|
|||
- Contributors of `libsecp256k1 <https://github.com/bitcoin-core/secp256k1>`_. |
|||
- Contributors of `secp256k1-py <https://github.com/ludbb/secp256k1-py>`_. |
|||
While Coincurve is nearly a complete rewrite, much of the build system |
|||
provided by `ulope <https://github.com/ulope>`_ remains. |
|||
|
|||
History |
|||
------- |
|||
|
|||
Important changes are emphasized. |
|||
|
|||
13.0.0 |
|||
^^^^^^ |
|||
|
|||
- **New:** Binary wheels for Python 3.8! |
|||
- Support building on OpenBSD |
|||
- Improve handling of PEM private key deserialization |
|||
- Improve ECDH documentation |
|||
- Improvements from libsecp256k1 master |
|||
|
|||
12.0.0 |
|||
^^^^^^ |
|||
|
|||
- **New:** Binary wheels on Linux for PyPy3.6 v7.1.1-beta! |
|||
- **New:** Binary wheels on macOS for Python 3.8.0-alpha.3! |
|||
- **New:** Binary wheels on Linux are now also built with the new `manylinux2010 <https://www.python.org/dev/peps/pep-0571>`_ spec for 64-bit platforms! |
|||
- Improvements from libsecp256k1 master |
|||
|
|||
11.0.0 |
|||
^^^^^^ |
|||
|
|||
- Fix some linking scenarios by placing bundled libsecp256k1 dir first in path |
|||
- Allow override of system libsecp256k1 with environment variable |
|||
- Add benchmarks |
|||
- Use Codecov to track coverage |
|||
- Use black for code formatting |
|||
|
|||
10.0.0 |
|||
^^^^^^ |
|||
|
|||
- Support tox for testing |
|||
- Compatibility with latest libsecp256k1 ECDH API |
|||
- Make libgmp optional when building from source |
|||
|
|||
9.0.0 |
|||
^^^^^ |
|||
|
|||
- Fixed wheels for macOS |
|||
- **Breaking:** Drop support for 32-bit macOS |
|||
|
|||
View `all history <https://github.com/ofek/coincurve/blob/master/HISTORY.rst>`_ |
@ -1,3 +1,4 @@ |
|||
from coincurve.context import GLOBAL_CONTEXT, Context |
|||
from coincurve.keys import PrivateKey, PublicKey |
|||
from coincurve.utils import verify_signature |
|||
|
|||
|
@ -0,0 +1,13 @@ |
|||
import sys |
|||
from typing import Optional, Tuple |
|||
|
|||
from ._libsecp256k1 import ffi |
|||
|
|||
# https://bugs.python.org/issue42965 |
|||
if sys.version_info >= (3, 9, 2): |
|||
from collections.abc import Callable |
|||
else: |
|||
from typing import Callable |
|||
|
|||
Hasher = Optional[Callable[[bytes], bytes]] |
|||
Nonce = Tuple[ffi.CData, ffi.CData] |
@ -0,0 +1,3 @@ |
|||
def patch(lines): |
|||
"""This ensures that links and abbreviations are always available.""" |
|||
lines.extend(('', '--8<-- "refs.txt"', '')) |
@ -0,0 +1,2 @@ |
|||
*[ECDH]: Elliptic-curve Diffie–Hellman |
|||
*[PyPI]: Python Package Index |
@ -0,0 +1,5 @@ |
|||
[Bitcoin Core]: https://github.com/bitcoin/bitcoin |
|||
[ECDH]: https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman |
|||
[RFC 6979]: https://tools.ietf.org/html/rfc6979 |
|||
[libsecp256k1]: https://github.com/bitcoin-core/secp256k1 |
|||
[secp256k1]: https://en.bitcoin.it/wiki/Secp256k1 |
@ -0,0 +1,4 @@ |
|||
--8<-- |
|||
links.txt |
|||
abbrs.txt |
|||
--8<-- |
@ -0,0 +1,50 @@ |
|||
# Developer Interface |
|||
|
|||
----- |
|||
|
|||
All objects are available directly under the root namespace `coincurve`. |
|||
|
|||
::: coincurve.verify_signature |
|||
rendering: |
|||
show_root_full_path: false |
|||
selection: |
|||
docstring_style: restructured-text |
|||
|
|||
::: coincurve.PrivateKey |
|||
rendering: |
|||
show_root_full_path: false |
|||
selection: |
|||
docstring_style: restructured-text |
|||
members: |
|||
- __init__ |
|||
- sign |
|||
- sign_recoverable |
|||
- ecdh |
|||
- add |
|||
- multiply |
|||
- to_hex |
|||
- to_pem |
|||
- to_der |
|||
- to_int |
|||
- from_hex |
|||
- from_pem |
|||
- from_der |
|||
- from_int |
|||
|
|||
::: coincurve.PublicKey |
|||
rendering: |
|||
show_root_full_path: false |
|||
selection: |
|||
docstring_style: restructured-text |
|||
members: |
|||
- __init__ |
|||
- verify |
|||
- format |
|||
- point |
|||
- combine |
|||
- add |
|||
- multiply |
|||
- combine_keys |
|||
- from_signature_and_message |
|||
- from_secret |
|||
- from_point |
@ -0,0 +1,61 @@ |
|||
/* https://github.com/squidfunk/mkdocs-material/issues/1522 */ |
|||
.md-typeset h5 { |
|||
color: var(--md-default-fg-color); |
|||
text-transform: none; |
|||
} |
|||
|
|||
/* https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/ */ |
|||
.md-typeset .tabbed-set { |
|||
border: 1px solid #eee; |
|||
} |
|||
.md-typeset .tabbed-content { |
|||
padding: 0.5em 1em; |
|||
} |
|||
|
|||
/* Brighter links for dark mode */ |
|||
[data-md-color-scheme=slate] { |
|||
--md-text-link-color: var(--md-primary-fg-color--light); |
|||
} |
|||
|
|||
/* FiraCode https://github.com/tonsky/FiraCode */ |
|||
code { font-family: 'Fira Code', monospace; } |
|||
|
|||
@supports (font-variation-settings: normal) { |
|||
code { font-family: 'Fira Code VF', monospace; } |
|||
} |
|||
|
|||
/* Everything below is from https://pawamoy.github.io/mkdocstrings/handlers/python/#recommended-style-material */ |
|||
|
|||
/* Indentation. */ |
|||
div.doc-contents:not(.first) { |
|||
padding-left: 25px; |
|||
border-left: 4px solid rgba(230, 230, 230); |
|||
margin-bottom: 80px; |
|||
} |
|||
|
|||
/* Don't capitalize names. */ |
|||
h5.doc-heading { |
|||
text-transform: none !important; |
|||
} |
|||
|
|||
/* Don't use vertical space on hidden ToC entries. */ |
|||
.hidden-toc::before { |
|||
margin-top: 0 !important; |
|||
padding-top: 0 !important; |
|||
} |
|||
|
|||
/* Don't show permalink of hidden ToC entries. */ |
|||
.hidden-toc a.headerlink { |
|||
display: none; |
|||
} |
|||
|
|||
/* Avoid breaking parameters name, etc. in table cells. */ |
|||
td code { |
|||
word-break: normal !important; |
|||
} |
|||
|
|||
/* For pieces of Markdown rendered in table cells. */ |
|||
td p { |
|||
margin-top: 0 !important; |
|||
margin-bottom: 0 !important; |
|||
} |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,131 @@ |
|||
# History |
|||
|
|||
----- |
|||
|
|||
Important changes are emphasized. |
|||
|
|||
## master |
|||
|
|||
## Unreleased |
|||
|
|||
## 17.0.0 |
|||
|
|||
- **Breaking:** Drop support for Python 3.6 |
|||
- Fix wheels for Apple M1 |
|||
- Upgrade [libsecp256k1][] to the latest available version |
|||
|
|||
## 16.0.0 |
|||
|
|||
- Wheels for Apple Silicon and musl linux (Alpine) |
|||
- No wheels for PyPy until the build system is fixed |
|||
|
|||
## 15.0.1 |
|||
|
|||
- Fix the `combine` method of `PublicKey` |
|||
|
|||
## 15.0.0 |
|||
|
|||
- **Breaking:** Drop support for Python 2 |
|||
- **Breaking:** Binary wheels for CPython require version 19.3 or later of ``pip`` to install |
|||
- Build AArch64 binary wheels for Linux |
|||
- Build binary wheels for PyPy3.6 7.3.3 & PyPy3.7 7.3.3 on Linux |
|||
- Upgrade [libsecp256k1][] to the latest available version |
|||
- Upgrade libgmp to the latest available version |
|||
- Introduce `COINCURVE_UPSTREAM_REF` environment variable to select an alternative [libsecp256k1][] version when building from source |
|||
- Support PEP 561 type hints |
|||
- Added support for supplying a custom nonce to `PrivateKey.sign_recoverable` |
|||
|
|||
## 14.0.0 |
|||
|
|||
**IMPORTANT: This will be the final release that supports Python 2.** |
|||
|
|||
- **New:** Binary wheels for Python 3.9 |
|||
- **Breaking:** Drop support for Python 3.5 |
|||
- Fetch [libsecp256k1][] source if the system installation lacks ECDH support |
|||
- Fix innocuous `setuptools` warning when building from source |
|||
- Switch CI/CD to GitHub Actions |
|||
|
|||
## 13.0.0 |
|||
|
|||
- **New:** Binary wheels for Python 3.8 |
|||
- Support building on OpenBSD |
|||
- Improve handling of PEM private key deserialization |
|||
- Improve ECDH documentation |
|||
- Improvements from [libsecp256k1][] master |
|||
|
|||
## 12.0.0 |
|||
|
|||
- **New:** Binary wheels on Linux for PyPy3.6 v7.1.1-beta |
|||
- **New:** Binary wheels on macOS for Python 3.8.0-alpha.3 |
|||
- **New:** Binary wheels on Linux are now also built with the new [manylinux2010](https://www.python.org/dev/peps/pep-0571) spec for 64-bit platforms |
|||
- Improvements from [libsecp256k1][] master |
|||
|
|||
## 11.0.0 |
|||
|
|||
- Fix some linking scenarios by placing bundled [libsecp256k1][] dir first in path |
|||
- Allow override of system [libsecp256k1][] with environment variable |
|||
- Add benchmarks |
|||
- Use Codecov to track coverage |
|||
- Use black for code formatting |
|||
|
|||
## 10.0.0 |
|||
|
|||
- Support tox for testing |
|||
- Compatibility with latest [libsecp256k1][] ECDH API |
|||
- Make libgmp optional when building from source |
|||
|
|||
## 9.0.0 |
|||
|
|||
- Fixed wheels for macOS |
|||
- **Breaking:** Drop support for 32-bit macOS |
|||
|
|||
## 8.0.2 |
|||
|
|||
- No longer package tests |
|||
|
|||
## 8.0.0 |
|||
|
|||
- **New:** Binary wheels for Python 3.7 |
|||
- **Changed:** Binary wheels on macOS for Python 3.5 now use Homebrew |
|||
Python for compilation due to new security requirements |
|||
- Make build system support new GitHub & PyPI security requirements |
|||
- Improvements from [libsecp256k1][] master |
|||
|
|||
## 7.1.0 |
|||
|
|||
- Pin version of [libsecp256k1][] |
|||
- Improve docs |
|||
|
|||
## 7.0.0 |
|||
|
|||
- Improvements from [libsecp256k1][] master |
|||
- Fix build script |
|||
|
|||
## 6.0.0 |
|||
|
|||
- Resolved #6. You can choose to use this or remain on `5.2.0`. This will only be a temporary change, see 3e93480b3e38c6b9beb0bc2de83bc3630fc74c46. |
|||
|
|||
## 5.2.0 |
|||
|
|||
- Added support for supplying a custom nonce to `PrivateKey.sign` |
|||
|
|||
## 5.1.0 |
|||
|
|||
- Added `PublicKey.combine_keys` class method |
|||
- Improvements to documentation |
|||
|
|||
## 5.0.1 |
|||
|
|||
- Fixed an issue where secret validation would occasionally erroneously error |
|||
on user-provided secrets (secrets not generated by Coincurve itself) if there |
|||
were not exactly 256 bits of entropy. See #5. |
|||
|
|||
## 5.0.0 |
|||
|
|||
- **Breaking:** Coincurve is now dual-licensed under the terms of `MIT` and `Apache-2.0` |
|||
- Performance improvements from [libsecp256k1][] master |
|||
- Improvements to documentation. |
|||
|
|||
## 4.5.1 |
|||
|
|||
- First public stable release |
@ -0,0 +1,49 @@ |
|||
# coincurve |
|||
|
|||
| | | |
|||
| --- | --- | |
|||
| CI/CD | [![CI - Test](https://github.com/ofek/coincurve/actions/workflows/build.yml/badge.svg)](https://github.com/ofek/coincurve/actions/workflows/build.yml) [![CI - Coverage](https://img.shields.io/codecov/c/github/ofek/coincurve/master.svg?logo=codecov&logoColor=red)](https://codecov.io/github/ofek/coincurve) | |
|||
| Docs | [![CI - Docs](https://github.com/ofek/coincurve/actions/workflows/docs.yml/badge.svg)](https://github.com/ofek/coincurve/actions/workflows/docs.yml) | |
|||
| Package | [![PyPI - Version](https://img.shields.io/pypi/v/coincurve.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/coincurve/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/coincurve.svg?color=blue&label=Downloads&logo=pypi&logoColor=gold)](https://pypi.org/project/coincurve/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/coincurve.svg?logo=python&label=Python&logoColor=gold)](https://pypi.org/project/coincurve/) | |
|||
| Meta | [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![types - Mypy](https://img.shields.io/badge/types-Mypy-blue.svg)](https://github.com/ambv/black) [![imports - isort](https://img.shields.io/badge/imports-isort-ef8336.svg)](https://github.com/pycqa/isort) [![License - MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-9400d3.svg)](https://spdx.org/licenses/) [![GitHub Sponsors](https://img.shields.io/github/sponsors/ofek?logo=GitHub%20Sponsors&style=social)](https://github.com/sponsors/ofek) | |
|||
|
|||
----- |
|||
|
|||
This library provides well-tested Python bindings for [libsecp256k1][], the heavily optimized |
|||
C library used by [Bitcoin Core][] for operations on the elliptic curve [secp256k1][]. |
|||
|
|||
## Features |
|||
|
|||
- Fastest available implementation (more than 10x faster than OpenSSL) |
|||
- Clean, easy to use API |
|||
- Frequent updates from the development version of [libsecp256k1][] |
|||
- Linux, macOS, and Windows all have binary packages for multiple architectures |
|||
- Deterministic signatures as specified by [RFC 6979][] |
|||
- Non-malleable signatures (lower-S form) by default |
|||
- Secure, non-malleable [ECDH][] implementation |
|||
|
|||
## Users |
|||
|
|||
- [Ethereum](https://ethereum.org) |
|||
- [LBRY](https://lbry.com) |
|||
- [ZeroNet](https://zeronet.io) |
|||
- [libp2p](https://libp2p.io) |
|||
|
|||
and [many more](users.md)! |
|||
|
|||
## License |
|||
|
|||
`coincurve` is distributed under the terms of any of the following licenses: |
|||
|
|||
- [MIT](https://spdx.org/licenses/MIT.html) |
|||
- [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) |
|||
|
|||
## Navigation |
|||
|
|||
Desktop readers can use keyboard shortcuts to navigate. |
|||
|
|||
| Keys | Action | |
|||
| --- | --- | |
|||
| <ul><li><kbd>,</kbd> (comma)</li><li><kbd>p</kbd></li></ul> | Navigate to the "previous" page | |
|||
| <ul><li><kbd>.</kbd> (period)</li><li><kbd>n</kbd></li></ul> | Navigate to the "next" page | |
|||
| <ul><li><kbd>/</kbd></li><li><kbd>s</kbd></li></ul> | Display the search modal | |
@ -0,0 +1,62 @@ |
|||
# Installation |
|||
|
|||
----- |
|||
|
|||
`coincurve` is available on PyPI and can be installed with [pip](https://pip.pypa.io): |
|||
|
|||
``` |
|||
pip install coincurve |
|||
``` |
|||
|
|||
## Wheel |
|||
|
|||
Binary wheels are available for most platforms and require at least version `19.3` of pip to install. |
|||
|
|||
| | | | | | |
|||
| --- | --- | --- | --- | --- | |
|||
| | macOS | Windows | Linux (glibc) | Linux (musl) | |
|||
| CPython 3.7 | <ul><li>x86_64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | |
|||
| CPython 3.8 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | |
|||
| CPython 3.9 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | |
|||
| CPython 3.10 | <ul><li>x86_64</li><li>ARM64</li></ul> | <ul><li>x86_64</li><li>x86</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | <ul><li>x86_64</li><li>i686</li><li>AArch64</li></ul> | |
|||
|
|||
## Source |
|||
|
|||
If you are on a platform without support for pre-compiled wheels, you will need certain system packages in order to build from source. |
|||
|
|||
A few environment variables influence the build: |
|||
|
|||
- `COINCURVE_UPSTREAM_REF` - This is the Git reference of [libsecp256k1][] to use rather than the (frequently updated) default. |
|||
- `COINCURVE_IGNORE_SYSTEM_LIB` - The presence of this will force fetching of [libsecp256k1][] even if it's already detected at the system level. |
|||
|
|||
!!! tip |
|||
To avoid installing the binary wheels on compatible distributions, use the `--no-binary` option. |
|||
|
|||
``` |
|||
pip install coincurve --no-binary coincurve |
|||
``` |
|||
|
|||
### Alpine |
|||
|
|||
``` |
|||
sudo apk add autoconf automake build-base libffi-dev libtool pkgconfig python3-dev |
|||
``` |
|||
|
|||
### Debian/Ubuntu |
|||
|
|||
``` |
|||
sudo apt-get install -y autoconf automake build-essential libffi-dev libtool pkg-config python3-dev |
|||
``` |
|||
|
|||
### RHEL/CentOS |
|||
|
|||
``` |
|||
sudo yum install -y autoconf automake gcc gcc-c++ libffi-devel libtool make pkgconfig python3-devel |
|||
``` |
|||
|
|||
### macOS |
|||
|
|||
``` |
|||
xcode-select --install |
|||
brew install autoconf automake libffi libtool pkg-config python |
|||
``` |
@ -0,0 +1,43 @@ |
|||
# Users |
|||
|
|||
----- |
|||
|
|||
## Organizations |
|||
|
|||
| Name | Projects | |
|||
| --- | --- | |
|||
| [Anyl](https://github.com/Anylsite) | <ul><li><a href=https://github.com/Anylsite/anyledger-backend/blob/cb9e277ef4ba775384a1eb80ff1577418f88684e/requirements.in#L5> anyledger-backend </a></li></ul> | |
|||
| [ARK](https://ark.io) | <ul><li><a href=https://github.com/ArkEcosystem/python-crypto/blob/1bd016f76b41eba9711be748c1caf20d8042f590/setup.py#L9> python-crypto </a></li></ul> | |
|||
| [Augur](https://www.augur.net) | <ul><li><a href=https://github.com/AugurProject/augur-core/blob/5388e00120d3e2328b5ccc70960bedff1c8a03dd/requirements.txt#L9> augur-core </a></li></ul> | |
|||
| [Blockcerts](https://www.blockcerts.org) | <ul><li><a href=https://github.com/blockchain-certificates/cert-issuer/blob/9b0ed451ef686018a507acd8bb7d217263a6fbf4/ethereum_requirements.txt#L2> cert-issuer </a></li></ul> | |
|||
| [ECIES](https://ecies.org) | <ul><li><a href=https://github.com/ecies/py/blob/7d4bd252129410eb1472d9e3cf0fd9f1fcfaf174/pyproject.toml#L38> py </a></li></ul> | |
|||
| [Elements](https://elementsproject.org) | <ul><li><a href=https://github.com/ElementsProject/lightning/blob/d134580419b90f2299cfa3646906b8b8b96c356e/requirements.txt#L33> lightning </a></li></ul> | |
|||
| [Ethereum](https://ethereum.org) | <ul><li><a href=https://github.com/ethereum/alexandria/blob/adba4114fbd5f707181da602abd977e008e463c9/setup.py#L67> alexandria </a></li><li><a href=https://github.com/ethereum/ddht/blob/341e84e9163338556cd48dd2fcfda9eedec3eb45/setup.py#L73> ddht </a></li><li><a href=https://github.com/ethereum/eth-keys/blob/dd4f00a5d2f2b394665ccecc9817f753e58cc7bc/setup.py#L10> eth-keys </a></li><li><a href=https://github.com/ethereum/eth-tester/blob/1e37e846915374914bdc2950fbb2f9ea6ca2f3ec/tox.ini#L16> eth-tester </a></li><li><a href=https://github.com/ethereum/py-evm/blob/5e949a457fbe6692dcd9e9e2f141a1848000a0c2/setup.py#L26> py-evm </a></li><li><a href=https://github.com/ethereum/pydevp2p/blob/b09b8a06a152f34cd7dc7950b14b04e3f01511af/requirements.txt#L8> pydevp2p </a></li><li><a href=https://github.com/ethereum/trinity/blob/65609f8fda7d880c0efe859ea84a7d0935c02edb/setup.py#L39> trinity </a></li></ul> | |
|||
| [Gnosis](https://gnosis.io) | <ul><li><a href=https://github.com/gnosis/gnosis-py/blob/7bad62eb83b50cf952227f5ae1019c95b8b4d9cd/README.rst#quick-start> gnosis-py </a></li></ul> | |
|||
| [Golem Network](https://golem.network) | <ul><li><a href=https://github.com/golemfactory/concent/blob/23ffa9464c995a628aa570bc9a0a05d29f48b044/concent_api/requirements.lock#L18> concent </a></li><li><a href=https://github.com/golemfactory/golem/blob/6280b5d946640e81c475c66c5de4a9e53cbfcc69/requirements.txt#L25> golem </a></li><li><a href=https://github.com/golemfactory/golem-messages/blob/aae2a60a88c938f5ed7012b838cf2a29934b58b2/setup.py#L41> golem-messages </a></li></ul> | |
|||
| [ICON Foundation](https://icon.foundation) | <ul><li><a href=https://github.com/icon-project/goloop/blob/6c8341e0c29fc7f9136221f315e8a76af9b5450c/pyee/requirements.txt#L2> goloop </a></li><li><a href=https://github.com/icon-project/icon-sdk-python/blob/cb293688c154349cabeb9b3f50a1cab29e91859d/requirements.txt#L2> icon-sdk-python </a></li><li><a href=https://github.com/icon-project/icon-service/blob/73c8d4521374207ef77e63b789fd511fc6d028b8/requirements.txt#L3> icon-service </a></li><li><a href=https://github.com/icon-project/loopchain/blob/9f29e8914918e12d683f2e1318c9b3c52dbee08d/requirements.txt#L11> loopchain </a></li><li><a href=https://github.com/icon-project/t-bears/pull/77> t-bears </a></li></ul> | |
|||
| [LBRY](https://lbry.com) | <ul><li><a href=https://github.com/lbryio/lbry-android-sdk/blob/b0331248cdb7b1ca4a866e4aaa166dd820549e56/recipes/coincurve/__init__.py> lbry-android-sdk </a></li><li><a href=https://github.com/lbryio/lbry-sdk/blob/7486ee95371c238d51e1c2552113ad25bfaf0426/setup.py#L53> lbry-sdk </a></li></ul> | |
|||
| [libp2p](https://libp2p.io) | <ul><li><a href=https://github.com/libp2p/py-libp2p/blob/12786f4e26783b530279a6f89089cf69af8e3922/setup.py#L73> py-libp2p </a></li></ul> | |
|||
| [Microsoft](https://www.microsoft.com) | <ul><li><a href=https://github.com/microsoft/CCF/blob/f6670587ec1cb6c0faf8efcc6e4d08b8f4c1fd60/tests/requirements.txt#L4> CCF </a></li></ul> | |
|||
| [NuCypher](https://www.nucypher.com) | <ul><li><a href=https://github.com/nucypher/nucypher/blob/24a57e1c810aa6408ecfc24942956925146aa024/requirements.txt#L16> nucypher </a></li><li><a href=https://github.com/nucypher/nucypher-monitor/blob/f8df51a37d0299c36541b26ef13d72fa390c294e/requirements.txt#L17> nucypher-monitor </a></li></ul> | |
|||
| [Quantstamp](https://quantstamp.com) | <ul><li><a href=https://github.com/quantstamp/qsp-protocol-node/blob/6f776b01c91a3b1c306ab74932324ea367fa6157/requirements.txt#L32> qsp-protocol-node </a></li></ul> | |
|||
| [QuarkChain](https://www.quarkchain.io) | <ul><li><a href=https://github.com/QuarkChain/pyquarkchain/blob/1f858f46efe31c3fb3bac20cdbd44eb94d89fb63/requirements.txt#L4> pyquarkchain </a></li></ul> | |
|||
| [Raiden Network](https://raiden.network) | <ul><li><a href=https://github.com/raiden-network/demo-train/blob/66d187bd4f9e83a7d8d0cc43fc5d31c8444745f5/requirements.txt#L16> demo-train </a></li><li><a href=https://github.com/raiden-network/light-client/blob/8da39f8f164a3d93674889db39875003e1bc6e93/e2e-environment/synapse/auth/eth_auth_provider.py#L20> light-client </a></li><li><a href=https://github.com/raiden-network/microraiden/blob/2d51e78afaf3c0a8ddab87e59a5260c0064cdbdd/requirements.txt#L5> microraiden </a></li><li><a href=https://github.com/raiden-network/raiden/blob/e4c0f6d22788eddf51da551f11ea988a8dd5fd0d/requirements/requirements.in#L4> raiden </a></li><li><a href=https://github.com/raiden-network/raiden-contracts/blob/93230caa554f6f29e55b4521aafd0af20b710b1f/requirements.txt#L3> raiden-contracts </a></li><li><a href=https://github.com/raiden-network/raiden-service-bundle/blob/1ba6a265016eca4ade0ed4f2a198cebc570c11d3/build/synapse/Dockerfile#L18> raiden-service-bundle </a></li><li><a href=https://github.com/raiden-network/raiden-services/blob/b5d0f81447fbe476ed8185d825560b2b9327d455/src/raiden_libs/utils.py#L4> raiden-services </a></li><li><a href=https://github.com/raiden-network/raiden-wizard/blob/bf2fe8662be4db2c36bcc920d8e31cec888a496e/requirements.txt#L17> raiden-wizard </a></li><li><a href=https://github.com/raiden-network/raidex/blob/master/requirements.txt#L12> raidex </a></li></ul> | |
|||
| [SKALE Network](https://skale.network) | <ul><li><a href=https://github.com/skalenetwork/libBLS/blob/785b7ab11f78512f6466b6dc996c4db44825696a/.travis.yml#L46> libBLS </a></li><li><a href=https://github.com/skalenetwork/sgx.py/blob/efff7d1a09abbea2c703cc21b25f9a6d9e7fcb79/setup.py#L11> sgx.py </a></li></ul> | |
|||
|
|||
## Projects |
|||
|
|||
- [bit](https://github.com/ofek/bit/blob/776f97ae7f9b3f05157113abc913eb141b2817ee/setup.py#L44) |
|||
- [btcrecover](https://github.com/gurnec/btcrecover/commit/f113867fa22d2f5b22175cc2b5b3892351bc1109) |
|||
- [crankycoin](https://github.com/cranklin/crankycoin/blob/7663a1c5429b3ddd11997b6a2e3488018789bf3b/requirements.txt#L2) |
|||
- [ForkDelta](https://github.com/forkdelta/backend-replacement/blob/97ccd1a19544f26d242a8412113086f0c0dd5760/requirements.txt#L46) |
|||
- [Heimdall](https://github.com/maddevsio/heimdall/blob/21f16880030cfdb1c1c97969158bec02ca6c0336/requirements.txt#L14) |
|||
- [HoneyBadgerBFT](https://github.com/initc3/HoneyBadgerBFT-Python/blob/e8bcbc081dfb5d1e7298039d47bbebf7048b8e62/setup.py#L30) |
|||
- [JoinMarket](https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/dc581e9c99d7db6436ed9f8913b6ce614bcef8d8/jmbitcoin/setup.py#L13) |
|||
- [minichain](https://github.com/kigawas/minichain/blob/0ae0437fdc4aa05e73c4d31a8df91d371542c8fe/pyproject.toml#L13) |
|||
- [Nekoyume](https://github.com/nekoyume/nekoyume/blob/0dec2d6f1002091f3f727bd645ce67fadd85faeb/setup.cfg#L45) |
|||
- [NuCypher](https://github.com/nucypher/nucypher/blob/24a57e1c810aa6408ecfc24942956925146aa024/requirements.txt#L16) |
|||
- [python-idex](https://github.com/sammchardy/python-idex/blob/24cee970172491a7f7d5f52558727a77384cce26/requirements.txt#L2) |
|||
- [Rotki](https://github.com/rotki/rotki/blob/70508f99f890bcbd520f1efe7776194d6a5e5e06/requirements.txt#L8) |
|||
- [Vyper](https://github.com/vyperlang/vyper/blob/3bd0bf96856554810065fa9cfb89afef7625d436/Dockerfile#L15) |
|||
- [ZeroNet](https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/requirements.txt#L12) |
@ -0,0 +1,123 @@ |
|||
site_name: coincurve |
|||
site_description: Cross-platform Python bindings for libsecp256k1 |
|||
site_author: Ofek Lev |
|||
site_url: https://ofek.dev/coincurve/ |
|||
repo_name: ofek/coincurve |
|||
repo_url: https://github.com/ofek/coincurve |
|||
edit_uri: blob/master/docs |
|||
copyright: 'Copyright © Ofek Lev 2017-present' |
|||
|
|||
docs_dir: docs |
|||
site_dir: site |
|||
theme: |
|||
name: material |
|||
language: en |
|||
features: |
|||
- navigation.instant |
|||
palette: |
|||
- media: "(prefers-color-scheme: dark)" |
|||
scheme: slate |
|||
primary: teal |
|||
accent: teal |
|||
toggle: |
|||
icon: material/weather-night |
|||
name: Switch to light mode |
|||
- media: "(prefers-color-scheme: light)" |
|||
scheme: default |
|||
primary: teal |
|||
accent: teal |
|||
toggle: |
|||
icon: material/weather-sunny |
|||
name: Switch to dark mode |
|||
font: |
|||
text: Roboto |
|||
code: Roboto Mono |
|||
icon: |
|||
logo: material/circle-multiple |
|||
repo: fontawesome/brands/github-alt |
|||
favicon: assets/images/favicon.ico |
|||
|
|||
nav: |
|||
- About: index.md |
|||
- Install: install.md |
|||
- API Reference: api.md |
|||
- Users: users.md |
|||
- History: history.md |
|||
|
|||
plugins: |
|||
# Built-in |
|||
- search: |
|||
# Extra |
|||
- minify: |
|||
minify_html: true |
|||
- git-revision-date-localized: |
|||
type: date |
|||
- mkdocstrings: |
|||
default_handler: python |
|||
handlers: |
|||
python: |
|||
rendering: |
|||
show_if_no_docstring: true |
|||
show_root_heading: true |
|||
show_source: true |
|||
|
|||
markdown_extensions: |
|||
# Built-in |
|||
- markdown.extensions.abbr: |
|||
- markdown.extensions.admonition: |
|||
- markdown.extensions.footnotes: |
|||
- markdown.extensions.meta: |
|||
- markdown.extensions.tables: |
|||
- markdown.extensions.toc: |
|||
permalink: true |
|||
# Extra |
|||
- mkpatcher: |
|||
location: docs/.scripts |
|||
- pymdownx.arithmatex: |
|||
- pymdownx.betterem: |
|||
smart_enable: all |
|||
- pymdownx.caret: |
|||
- pymdownx.critic: |
|||
- pymdownx.details: |
|||
- pymdownx.emoji: |
|||
# https://github.com/twitter/twemoji |
|||
# https://raw.githubusercontent.com/facelessuser/pymdown-extensions/master/pymdownx/twemoji_db.py |
|||
emoji_index: !!python/name:materialx.emoji.twemoji |
|||
emoji_generator: !!python/name:materialx.emoji.to_svg |
|||
- pymdownx.highlight: |
|||
guess_lang: false |
|||
linenums_style: pymdownx-inline |
|||
use_pygments: true |
|||
- pymdownx.inlinehilite: |
|||
- pymdownx.keys: |
|||
- pymdownx.magiclink: |
|||
repo_url_shortener: true |
|||
repo_url_shorthand: true |
|||
social_url_shorthand: true |
|||
provider: github |
|||
user: ofek |
|||
repo: coincurve |
|||
- pymdownx.mark: |
|||
- pymdownx.progressbar: |
|||
- pymdownx.smartsymbols: |
|||
- pymdownx.snippets: |
|||
base_path: docs/.snippets |
|||
- pymdownx.superfences: |
|||
- pymdownx.tabbed: |
|||
- pymdownx.tasklist: |
|||
custom_checkbox: true |
|||
- pymdownx.tilde: |
|||
|
|||
extra: |
|||
social: |
|||
- icon: fontawesome/brands/github-alt |
|||
link: https://github.com/ofek |
|||
- icon: fontawesome/solid/blog |
|||
link: https://ofek.dev/words/ |
|||
- icon: fontawesome/brands/twitter |
|||
link: https://twitter.com/Ofekmeister |
|||
- icon: fontawesome/brands/linkedin |
|||
link: https://www.linkedin.com/in/ofeklev/ |
|||
extra_css: |
|||
- assets/css/custom.css |
|||
- https://cdn.jsdelivr.net/gh/tonsky/FiraCode@5.2/distr/fira_code.css |
@ -0,0 +1,8 @@ |
|||
[mypy] |
|||
disallow_untyped_defs = false |
|||
follow_imports = normal |
|||
ignore_missing_imports = true |
|||
pretty = true |
|||
show_column_numbers = true |
|||
warn_no_return = false |
|||
warn_unused_ignores = true |
@ -1,40 +0,0 @@ |
|||
import os |
|||
import subprocess |
|||
import sys |
|||
|
|||
import appdirs |
|||
|
|||
|
|||
def main(): |
|||
here = os.path.dirname(os.path.abspath(__file__)) |
|||
os.chdir(here) |
|||
|
|||
version = sys.argv[-1] |
|||
delete = not not sys.argv[-2] == '-d' |
|||
delete_only = not not sys.argv[-2] == '--d' |
|||
|
|||
try: |
|||
subprocess.call('git -h') |
|||
git_path = 'git' |
|||
except: |
|||
git_path = None |
|||
|
|||
if git_path is None: |
|||
raise OSError('Unable to find git executable.') |
|||
|
|||
cmds = ['{0} tag -a {1} -m "Version {1}"'.format(git_path, version), '{} push origin {}'.format(git_path, version)] |
|||
delete_cmd = '{} tag -d {}'.format(git_path, version) |
|||
|
|||
if delete: |
|||
cmds.insert(0, delete_cmd) |
|||
elif delete_only: |
|||
cmds = [delete_cmd] |
|||
|
|||
for cmd in cmds: |
|||
subprocess.call(cmd) |
|||
|
|||
print(cmds) |
|||
|
|||
|
|||
if __name__ == '__main__': |
|||
main() |
@ -1,2 +0,0 @@ |
|||
[wheel] |
|||
universal = 0 |
Loading…
Reference in new issue