cryptomite
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}
}
Release files for cryptomite 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cryptomite-0.3.0.tar.gz | 466.3 kB | Details |
Built distributions (wheels)
Total release size: 2.7 MB
Release files / cryptomite-0.3.0.tar.gz
| Download URL | cryptomite-0.3.0.tar.gz |
|---|---|
| Size | 466.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24d7adff93779b78eccbe534e3bf8a9b654d5aaccfde3c17e0b048e984a1909e
|
|
BLAKE2b-256 checksum How to use checksums |
ebd546ce30b3c4bdc3acc24ab542c9a2e6d9d50f476491bd97662bc94f703e9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp313-cp313-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 134.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a39d72b4d49c4d4366457d9fc626d152a5d6cda7121f14bb8f3cc2b9023f6155
|
|
BLAKE2b-256 checksum How to use checksums |
e034bfbbe00473c10763d0893b715c6e6faadedb8f69ea066ee32da59df25953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp313-cp313-macosx_14_0_arm64.whl
| Download URL | cryptomite-0.3.0-cp313-cp313-macosx_14_0_arm64.whl |
|---|---|
| Size | 117.4 kB |
| Tags | CPython 3.13 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ffcbc0aeba20ebd99650dd12d27b74e42eecf2804bc96a73a147971c1a2915d6
|
|
BLAKE2b-256 checksum How to use checksums |
49cf91d0c1f0703a6816323db8adb064ae6861ad02bc7ebe3c79df75efedcce8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp313-cp313-macosx_13_0_x86_64.whl
| Download URL | cryptomite-0.3.0-cp313-cp313-macosx_13_0_x86_64.whl |
|---|---|
| Size | 123.3 kB |
| Tags | CPython 3.13 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
ad7bf97e5e8a7b81a8a725e4a20627cb66b3521a87f51b10d1f03b5d5afba377
|
|
BLAKE2b-256 checksum How to use checksums |
fdbc1864e338c4e252237baec695a4289640b21d2cbc5340367570a48931f558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp312-cp312-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 134.7 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
85b8ace17886f87fc566d896fad15bbb86a9c652776a848db82c24af2471d415
|
|
BLAKE2b-256 checksum How to use checksums |
7695ee13aa7b67b0585b0a5ab292593018567166e133bcf912c3a480096907c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | cryptomite-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 159.0 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1c1837c132ce5d5fb85f76183574a8cde5b7e234039c0994b5d929b0f3f79d43
|
|
BLAKE2b-256 checksum How to use checksums |
e7d256636d78c2b8828cba0d5fae5c77c561e784761af5491fa234612a3a6c12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp312-cp312-macosx_14_0_arm64.whl
| Download URL | cryptomite-0.3.0-cp312-cp312-macosx_14_0_arm64.whl |
|---|---|
| Size | 117.4 kB |
| Tags | CPython 3.12 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ab48f1048a090dd06377339a4f4f27e2464cc74fc7ce34e9c800e183d0d2202c
|
|
BLAKE2b-256 checksum How to use checksums |
2ef5cebaa2fd54a0352b5a01d8ca722ad1979dda7a1e3af32694646fd0003288
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp311-cp311-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 134.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e0548a7f36b0b3ae0cabfd21ab372f90493f32e0cacfdad99eba682da656dca9
|
|
BLAKE2b-256 checksum How to use checksums |
1560c0292cbcb624559b4f75ec1bf3f1993576e8f72002d84fc46549098e9ec3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | cryptomite-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 161.6 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6a1052b43d3f1674837ffe680bb7ca9efff6465f471b57a0b5860592906a600b
|
|
BLAKE2b-256 checksum How to use checksums |
6eb6c2c59cba12308c9fe56e4f21de10d8b27ae870fa88194c2361c1e47cf7d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp311-cp311-macosx_14_0_arm64.whl
| Download URL | cryptomite-0.3.0-cp311-cp311-macosx_14_0_arm64.whl |
|---|---|
| Size | 117.6 kB |
| Tags | CPython 3.11 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f1afc2af04cbf542ecc4660b401925c22700798b0845cd1c834036b14fe26553
|
|
BLAKE2b-256 checksum How to use checksums |
a8bf840d78b5e53f3d9a424087f8300abcfff513f0c32353d91fa13389de798c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp310-cp310-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 133.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3e32b9c1333de0653b92b03308f5d4bced277ba070e382b6b823bbf6b44e840f
|
|
BLAKE2b-256 checksum How to use checksums |
2f86bd25602e28af26fe465ac9ba7963debc2b5cd38d133f77e8706f4d6afd10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | cryptomite-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 160.8 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9e2387085f10ab44c64d839e4b72405d92f1dd6220467bc88aa78804e05f629a
|
|
BLAKE2b-256 checksum How to use checksums |
c8b093deda5c4f7f81d0d8cf3b6c11b8a116e3348a7c2f5843b4a2ea9de7f5cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp310-cp310-macosx_14_0_arm64.whl
| Download URL | cryptomite-0.3.0-cp310-cp310-macosx_14_0_arm64.whl |
|---|---|
| Size | 116.3 kB |
| Tags | CPython 3.10 macOS 14.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fd4f4c0acd47a1ff8953193b58a8e61aa01394e2217ff1d9337e279b63a3a91e
|
|
BLAKE2b-256 checksum How to use checksums |
3db8fd5490cc63e7025505d3cdb93ed80305e03eeacfa2bc314134857d5e2770
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp39-cp39-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 132.6 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
06782a3613c8607a1a25cc8d4386fe7c84af73efd4d97ed91d7288bb859a2749
|
|
BLAKE2b-256 checksum How to use checksums |
5bd2f9d1a18382b719a2341c858ffb254047ccb40e7e8823314ec4e092688e15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | cryptomite-0.3.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 160.7 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
de77def3f581d00bfa6ba78b79cadc693a2d9c0b3069581f50a0fd5569346831
|
|
BLAKE2b-256 checksum How to use checksums |
f4a8e299409e6aa837d345b08c1ee7df93788a972f0065da7c8701f0ad936f50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp38-cp38-win_amd64.whl
| Download URL | cryptomite-0.3.0-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 133.4 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e11e8ac2aeee92a519949c9b056d683afcfe1d20da6e842176a512bf407a6b9c
|
|
BLAKE2b-256 checksum How to use checksums |
fdea65a7e1160c1c01778481754450bb76bf96dad936794c6eae1c57aad66a2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / cryptomite-0.3.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | cryptomite-0.3.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 160.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
cfaa0f6d28280f063f63f31e372bb0e5777d557d42a3e75f1c071efd13cf706e
|
|
BLAKE2b-256 checksum How to use checksums |
5c9a79abdb54a393aa1ac1a7e941c3da408c56a7022552cab5b95a92a7a0dea1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|