Skip to main content

PySPX Build Status Coverage Status

This repository contains a Python package that provides bindings for SPHINCS+. It provides support for all parameter sets included as part of the SPHINCS+ submission to NIST's Post-Quantum Cryptography Standardization project.

While this package is functionally complete, it may still be subject to small API changes. Currently, the bindings only wrap the reference code. Code optimized for specific platforms (such as machines with AVX2 or AESNI support) is ignored.

Installation

The package is available on PyPI and can be installed by simply calling pip install pyspx.

For Linux, binary wheels are available based on the manylinux1 docker image. On other platforms it may take a few moments to compile the SPHINCS+ code. Currently the sphincsplus reference code requires openssl for its SHA256 function. When compiling from source, be sure to install openssl with development files.

API

After installing the package, import a specific instance of SPHINCS+ as follows (e.g. for shake256-128f):

import pyspx.shake256_128f

This exposes the following straight-forward functions. All parameters are assumed to be bytes objects. Similarly, the returned keys and signatures are bytes. The verify function returns a boolean indicating success or failure.

>>> public_key, secret_key = pyspx.shake256_128f.generate_keypair(seed)
>>> signature = pyspx.shake256_128f.sign(message, secret_key)
>>> pyspx.shake256_128f.verify(message, signature, public_key)
True

Additionally, the following attributes expose the expected sizes, as a consequence of the selected parameter set:

>>> pyspx.shake256_128f.crypto_sign_BYTES
29792
>>> pyspx.shake256_128f.crypto_sign_PUBLICKEYBYTES
64
>>> pyspx.shake256_128f.crypto_sign_SECRETKEYBYTES
128
>>> pyspx.shake256_128f.crypto_sign_SEEDBYTES
96

Custom SPHINCS+ parameters

It is fairly easy to compile with additional SPHINCS+ parameters. To do this, clone the repository, initialize the src/sphincsplus submodule, and add a new parameter set to src/sphincsplus/ref/params. Make sure to follow the params-sphincs-[parameters-shorthand].h naming convention. Installing the Python package from this modified source will expose the parameter set using the API described above.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySPX-0.4.0.tar.gz (338.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

PySPX-0.4.0-cp37-cp37m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.7m

PySPX-0.4.0-cp36-cp36m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.6m

PySPX-0.4.0-cp35-cp35m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.5m

PySPX-0.4.0-cp34-cp34m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.4m

PySPX-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 2.7mu

PySPX-0.4.0-cp27-cp27m-manylinux1_x86_64.whl (4.5 MB view details)

Uploaded CPython 2.7m

File details

Details for the file PySPX-0.4.0.tar.gz.

File metadata

  • Download URL: PySPX-0.4.0.tar.gz
  • Upload date:
  • Size: 338.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0.tar.gz
Algorithm Hash digest
SHA256 696b1b7bd6ae70963ea7e42b96ed29816af46dcea30bbac5740fc8f1641e8fb9
MD5 94dd60bc93b26dd6ecd135c4293b1113
BLAKE2b-256 4b100fb87f2c5a1129890b7c4d82df7eaed3aac6226e9f823f912ef716fd5825

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c341dd261707477cc53692e9cf95f5e6d2b9f8b23a6cecdb306fa1dc3240ecb8
MD5 0a47fcf12e52b6cba9fa2bd7e7d13258
BLAKE2b-256 633fa4ba32e8182be11c0ea5f419d1c7877ecc52b55d3e3843189867266550e0

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6fcc17c2976535656adedd00f2b69b47963b966cca4457fcdbb2a01ef85b07b3
MD5 83db901f82485ff1e1b9d092fd295d3b
BLAKE2b-256 6a38ed68b0ea91cc527ed95c090c256f31d1b4a6a3a47bbe6871e4693e185105

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5a8ca77d423a0836329e1ff38dc044a7db61595eac4bc37adad2d26f26367b6f
MD5 b5264e500d929e26d0729b449a7d8bf4
BLAKE2b-256 07a1854976f05be5379efd5db823ebec4eba8d651c44cbe44c9ad56ab1efd111

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp34-cp34m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.4m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 31361db815af03f33ce1c8a9caead74e86b1efcc6298f4c59ff5eef623ecc363
MD5 1324905786266057fb8c7c974fc9c44e
BLAKE2b-256 d4cf3a67001c7aa5402ea88d9ddff146b1398ac228ca594809727f047f06fa4c

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bbed30dcfa188224a9bd69f4f44e9e0d3bc8365190455c29975aed0e9e9961da
MD5 36050aba32c005d530c42961b084719a
BLAKE2b-256 2df84da493f4ebd525be2edd08b438afadbf6a38223ec8e0af5381f68d48cf13

See more details on using hashes here.

File details

Details for the file PySPX-0.4.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: PySPX-0.4.0-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for PySPX-0.4.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8de6fa4ea1c8bf917752cedac772066c04bc85a5d8604cec215f6b42423d9f6f
MD5 e955adc3dab10a1d238c5b28bd3a5574
BLAKE2b-256 00749bcdc4c05b7dc8afdb010ce54178f378c8c12fc541d8033548f7033e0ee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page