Skip to main content

An awesome extractor library

Project description

cryptomite

Build Status PyPI version Downloads Downloads arXiv

image

cryptomite is a modular, extensible high-level Python library of randomness extractors, created by Quantinuum's Quantum Cryptography team. At a high level, the library offers state-of-the-art randomness extractors that are easy to use, optimized for performance and numerically precise providing a trade-off of features that suit numerous practical use cases. Find more information in our accompanying paper. For additional examples of usage and guidance on getting started with Cryptomite, see our related blog post and repository documentation.

The library is available for non-commercial use only; see the license for details.

The performance-critical parts of the library (e.g. the number theoretic transform) are implemented in C++, while the rest of the library (e.g. parameter estimation) is implemented in Python for accessibility and ease of installation.

The package is available for Python 3.8 and higher on Mac, Windows and Linux. To install, type:

pip install cryptomite

Example Usage

from cryptomite.trevisan import Trevisan
from random import randint

n, m, max_eps = 1000, 200, 0.01

ext = Trevisan(n, m, max_eps)

input_bits = [randint(0, 1) for _ in range(n)]
seed_bits = [randint(0, 1) for _ in range(ext.ext.get_seed_length())]

output_bits = ext.extract(input_bits, seed_bits)

Documentation

To build the docs, run

cd docs
pip install -r requirements.txt
make clean
make html

Testing

Install pytest, then run pytest test.

To run the C++ tests, run

cmake .
make
test/runTest

How to Cite

If you use cryptomite in your research, please cite the accompanying paper:

@article{Foreman2025cryptomite,
  doi = {10.22331/q-2025-01-08-1584},
  url = {https://doi.org/10.22331/q-2025-01-08-1584},
  title = {Cryptomite: {A} versatile and user-friendly library of randomness extractors},
  author = {Foreman, Cameron and Yeung, Richie and Edgington, Alec and Curchod, Florian J.},
  journal = {{Quantum}},
  issn = {2521-327X},
  publisher = {{Verein zur F{\"{o}}rderung des Open Access Publizierens in den Quantenwissenschaften}},
  volume = {9},
  pages = {1584},
  month = jan,
  year = {2025}
}

If you make use of our improved Raz extractor, please also cite the following paper:

@article{foreman2025efficient,
  title={An efficient construction of Raz's two-source randomness extractor with improved parameters},
  author={Foreman, Cameron and Wooltorton, Lewis and Milner, Kevin and Curchod, Florian J},
  journal={arXiv preprint arXiv:2506.15547},
  year={2025}
}

Project details


Download files

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

Source Distribution

cryptomite-0.3.0.tar.gz (466.3 kB view details)

Uploaded Source

Built Distributions

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

cryptomite-0.3.0-cp313-cp313-win_amd64.whl (134.8 kB view details)

Uploaded CPython 3.13Windows x86-64

cryptomite-0.3.0-cp313-cp313-macosx_14_0_arm64.whl (117.4 kB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

cryptomite-0.3.0-cp313-cp313-macosx_13_0_x86_64.whl (123.3 kB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

cryptomite-0.3.0-cp312-cp312-win_amd64.whl (134.7 kB view details)

Uploaded CPython 3.12Windows x86-64

cryptomite-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (159.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

cryptomite-0.3.0-cp312-cp312-macosx_14_0_arm64.whl (117.4 kB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

cryptomite-0.3.0-cp311-cp311-win_amd64.whl (134.3 kB view details)

Uploaded CPython 3.11Windows x86-64

cryptomite-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (161.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

cryptomite-0.3.0-cp311-cp311-macosx_14_0_arm64.whl (117.6 kB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

cryptomite-0.3.0-cp310-cp310-win_amd64.whl (133.4 kB view details)

Uploaded CPython 3.10Windows x86-64

cryptomite-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (160.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

cryptomite-0.3.0-cp310-cp310-macosx_14_0_arm64.whl (116.3 kB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

cryptomite-0.3.0-cp39-cp39-win_amd64.whl (132.6 kB view details)

Uploaded CPython 3.9Windows x86-64

cryptomite-0.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (160.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

cryptomite-0.3.0-cp38-cp38-win_amd64.whl (133.4 kB view details)

Uploaded CPython 3.8Windows x86-64

cryptomite-0.3.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (160.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file cryptomite-0.3.0.tar.gz.

File metadata

  • Download URL: cryptomite-0.3.0.tar.gz
  • Upload date:
  • Size: 466.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0.tar.gz
Algorithm Hash digest
SHA256 24d7adff93779b78eccbe534e3bf8a9b654d5aaccfde3c17e0b048e984a1909e
MD5 e616c608c54cfe431fd44a72ff01a0e8
BLAKE2b-256 ebd546ce30b3c4bdc3acc24ab542c9a2e6d9d50f476491bd97662bc94f703e9a

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 134.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a39d72b4d49c4d4366457d9fc626d152a5d6cda7121f14bb8f3cc2b9023f6155
MD5 611864adf834680c7d44002b0e121bdb
BLAKE2b-256 e034bfbbe00473c10763d0893b715c6e6faadedb8f69ea066ee32da59df25953

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ffcbc0aeba20ebd99650dd12d27b74e42eecf2804bc96a73a147971c1a2915d6
MD5 4aa3c3edd264a1a59a7ddb6226957479
BLAKE2b-256 49cf91d0c1f0703a6816323db8adb064ae6861ad02bc7ebe3c79df75efedcce8

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 ad7bf97e5e8a7b81a8a725e4a20627cb66b3521a87f51b10d1f03b5d5afba377
MD5 082e062853d13af53f094920f89d245d
BLAKE2b-256 fdbc1864e338c4e252237baec695a4289640b21d2cbc5340367570a48931f558

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 134.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 85b8ace17886f87fc566d896fad15bbb86a9c652776a848db82c24af2471d415
MD5 0e6246c243929e22b5e01b79188cf245
BLAKE2b-256 7695ee13aa7b67b0585b0a5ab292593018567166e133bcf912c3a480096907c0

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1c1837c132ce5d5fb85f76183574a8cde5b7e234039c0994b5d929b0f3f79d43
MD5 49e5f6c201ed88861547aa6db41f105d
BLAKE2b-256 e7d256636d78c2b8828cba0d5fae5c77c561e784761af5491fa234612a3a6c12

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ab48f1048a090dd06377339a4f4f27e2464cc74fc7ce34e9c800e183d0d2202c
MD5 90935c64206aca48c53dad045d0d6696
BLAKE2b-256 2ef5cebaa2fd54a0352b5a01d8ca722ad1979dda7a1e3af32694646fd0003288

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 134.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e0548a7f36b0b3ae0cabfd21ab372f90493f32e0cacfdad99eba682da656dca9
MD5 b37544cb987ec7dd386d4def1a7b22c8
BLAKE2b-256 1560c0292cbcb624559b4f75ec1bf3f1993576e8f72002d84fc46549098e9ec3

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6a1052b43d3f1674837ffe680bb7ca9efff6465f471b57a0b5860592906a600b
MD5 4a7f178ffe33a5e142f0ef55b8a5d86a
BLAKE2b-256 6eb6c2c59cba12308c9fe56e4f21de10d8b27ae870fa88194c2361c1e47cf7d8

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f1afc2af04cbf542ecc4660b401925c22700798b0845cd1c834036b14fe26553
MD5 d5f7e7d5f353ba832eb204fa4e46779d
BLAKE2b-256 a8bf840d78b5e53f3d9a424087f8300abcfff513f0c32353d91fa13389de798c

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 133.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3e32b9c1333de0653b92b03308f5d4bced277ba070e382b6b823bbf6b44e840f
MD5 d9c9c555e0966e0455912195464931ff
BLAKE2b-256 2f86bd25602e28af26fe465ac9ba7963debc2b5cd38d133f77e8706f4d6afd10

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9e2387085f10ab44c64d839e4b72405d92f1dd6220467bc88aa78804e05f629a
MD5 c0e213433e4a4e707017cac465928bb1
BLAKE2b-256 c8b093deda5c4f7f81d0d8cf3b6c11b8a116e3348a7c2f5843b4a2ea9de7f5cc

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 fd4f4c0acd47a1ff8953193b58a8e61aa01394e2217ff1d9337e279b63a3a91e
MD5 3d2c6084d4dc79e35a1ab6f2751810f6
BLAKE2b-256 3db8fd5490cc63e7025505d3cdb93ed80305e03eeacfa2bc314134857d5e2770

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 132.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 06782a3613c8607a1a25cc8d4386fe7c84af73efd4d97ed91d7288bb859a2749
MD5 fb415b0d273a2d972ca525280aa4e809
BLAKE2b-256 5bd2f9d1a18382b719a2341c858ffb254047ccb40e7e8823314ec4e092688e15

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 de77def3f581d00bfa6ba78b79cadc693a2d9c0b3069581f50a0fd5569346831
MD5 933a4f32242f5c503bcbe33413c3ed4b
BLAKE2b-256 f4a8e299409e6aa837d345b08c1ee7df93788a972f0065da7c8701f0ad936f50

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cryptomite-0.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 133.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for cryptomite-0.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e11e8ac2aeee92a519949c9b056d683afcfe1d20da6e842176a512bf407a6b9c
MD5 b38e7c6030b2205cbaeb5b31ebb6dad1
BLAKE2b-256 fdea65a7e1160c1c01778481754450bb76bf96dad936794c6eae1c57aad66a2b

See more details on using hashes here.

File details

Details for the file cryptomite-0.3.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for cryptomite-0.3.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 cfaa0f6d28280f063f63f31e372bb0e5777d557d42a3e75f1c071efd13cf706e
MD5 2e434aeb03b6dea99e57170758628e7d
BLAKE2b-256 5c9a79abdb54a393aa1ac1a7e941c3da408c56a7022552cab5b95a92a7a0dea1

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