https://github.com/cqcl/cryptomite

Python library of efficient and numerically-precise randomness extractors

https://github.com/cqcl/cryptomite

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.1%) to scientific vocabulary

Keywords

cryptographic-algorithms cryptography ntt privacy-amplification quantum-cryptography quantum-key-distribution quantum-random-number-generator random-number-generators randomness-extraction toeplitz-hash
Last synced: 5 months ago · JSON representation

Repository

Python library of efficient and numerically-precise randomness extractors

Basic Info
Statistics
  • Stars: 31
  • Watchers: 4
  • Forks: 8
  • Open Issues: 3
  • Releases: 0
Topics
cryptographic-algorithms cryptography ntt privacy-amplification quantum-cryptography quantum-key-distribution quantum-random-number-generator random-number-generators randomness-extraction toeplitz-hash
Created almost 3 years ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

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:

bash pip install cryptomite

Example Usage

```python from cryptomite.trevisan import Trevisan from random import randint

n, m, max_eps = 1000, 200, 0.01

ext = Trevisan(n, m, max_eps)

inputbits = [randint(0, 1) for _ in range(n)] seedbits = [randint(0, 1) for _ in range(ext.ext.getseedlength())]

outputbits = ext.extract(inputbits, seed_bits) ```

Documentation

To build the docs, run

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

Note that the docs are built with Python 3.8, and it may not immediately work with other versions.

Testing

Install pytest, then run pytest test.

To run the C++ tests, run

bash 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} }

Owner

  • Name: Cambridge Quantum
  • Login: CQCL
  • Kind: organization
  • Location: Cambridge, UK

Quantum Software and Technologies

GitHub Events

Total
  • Issues event: 4
  • Watch event: 15
  • Delete event: 2
  • Issue comment event: 3
  • Push event: 45
  • Pull request review event: 5
  • Pull request review comment event: 7
  • Pull request event: 4
  • Fork event: 4
  • Create event: 2
Last Year
  • Issues event: 4
  • Watch event: 15
  • Delete event: 2
  • Issue comment event: 3
  • Push event: 45
  • Pull request review event: 5
  • Pull request review comment event: 7
  • Pull request event: 4
  • Fork event: 4
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 120
  • Total Committers: 5
  • Avg Commits per committer: 24.0
  • Development Distribution Score (DDS): 0.425
Past Year
  • Commits: 23
  • Committers: 3
  • Avg Commits per committer: 7.667
  • Development Distribution Score (DDS): 0.522
Top Committers
Name Email Commits
y-richie-y r****1@g****m 69
cforeman-cqc c****n@c****m 45
Mohamed Messaoud Louamri m****i@g****m 3
Sean Burton s****n@q****m 2
FCurchod 6****d 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 6
  • Total pull requests: 12
  • Average time to close issues: 26 days
  • Average time to close pull requests: about 2 months
  • Total issue authors: 4
  • Total pull request authors: 6
  • Average comments per issue: 0.17
  • Average comments per pull request: 0.5
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 6
  • Average time to close issues: 12 days
  • Average time to close pull requests: 10 days
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 0.5
  • Average comments per pull request: 0.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • y-richie-y (3)
  • mmlouamri (1)
  • amartin-m (1)
  • ricerkare (1)
Pull Request Authors
  • cforeman-cqc (7)
  • ela-lee-cqc (2)
  • mmlouamri (2)
  • kmilner (2)
  • y-richie-y (2)
  • sburton84 (1)
Top Labels
Issue Labels
good first issue (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 148 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 2
pypi.org: cryptomite

An awesome extractor library

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 148 Last month
Rankings
Dependent packages count: 6.6%
Average: 18.6%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/build_test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • s0/git-publish-subdir-action develop composite
.github/workflows/wheels.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v2 composite
docs/requirements.txt pypi
  • Sphinx ==4.4.0
  • ipykernel ==6.9.2
  • m2r2 ==0.3.2
  • nbformat ==5.1.3
  • nbsphinx ==0.8.8
  • numpydoc ==1.1.0
  • sphinx-argparse ==0.3.1
  • sphinx-rtd-theme ==1.0.0