Skip to content

Commit 15bccb8

Browse files
committed
Rename to cryptomite!
1 parent c991240 commit 15bccb8

32 files changed

+62
-62
lines changed

.github/workflows/build_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
SRC_DIR: extlib
10+
SRC_DIR: cryptomite
1111

1212
jobs:
1313
lint:

.github/workflows/linuxbuildwheels

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
set -evu
44

5-
cd /extlib
5+
cd /cryptomite
66
mkdir wheelhouse
77
mkdir audited
88

99
for pyX in $PY_VERS
1010
do
11-
cd /extlib
11+
cd /cryptomite
1212
export PYEX=/opt/python/${pyX}/bin/python
1313
${PYEX} -m pip install -U pip wheel scikit-build
1414
${PYEX} setup.py bdist_wheel -d "tmpwheel_${pyX}"
15-
auditwheel repair "tmpwheel_${pyX}/extlib-"*".whl" -w "audited/"
15+
auditwheel repair "tmpwheel_${pyX}/cryptomite-"*".whl" -w "audited/"
1616
done

.github/workflows/macosbuildwheel

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ cd ${GITHUB_WORKSPACE}
77
PYVER=`python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))'`
88
python -m pip install -U pip wheel scikit-build delocate
99
python setup.py bdist_wheel -d "${GITHUB_WORKSPACE}/tmpwheel_${PYVER}"
10-
delocate-wheel -v -w "${GITHUB_WORKSPACE}/wheelhouse/" "${GITHUB_WORKSPACE}/tmpwheel_${PYVER}/extlib-"*".whl"
10+
delocate-wheel -v -w "${GITHUB_WORKSPACE}/wheelhouse/" "${GITHUB_WORKSPACE}/tmpwheel_${PYVER}/cryptomite-"*".whl"

.github/workflows/wheels.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
- name: set up container
1515
run: |
1616
docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_x86_64:latest /bin/bash
17-
docker cp . linux_build:/extlib/
17+
docker cp . linux_build:/cryptomite/
1818
- name: run build
1919
run: |
2020
docker start linux_build
21-
docker exec -e PY_VERS="${PY_VERS}" linux_build /bin/bash -c "/extlib/.github/workflows/linuxbuildwheels"
21+
docker exec -e PY_VERS="${PY_VERS}" linux_build /bin/bash -c "/cryptomite/.github/workflows/linuxbuildwheels"
2222
mkdir wheelhouse
23-
docker cp linux_build:/extlib/audited/. wheelhouse/
23+
docker cp linux_build:/cryptomite/audited/. wheelhouse/
2424
- uses: actions/upload-artifact@v2
2525
with:
2626
name: linux_wheels

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# `extlib/version.py` is generated automatically by setuptools-scm
2-
extlib/version.py
1+
# `cryptomite/version.py` is generated automatically by setuptools-scm
2+
cryptomite/version.py
33

44
# development files
55
*.egg-info/
@@ -17,5 +17,5 @@ docs/_*
1717
# ignore scikit-build stuff
1818
_skbuild/
1919
*/*.so
20-
extlib/lib
21-
extlib/include
20+
cryptomite/lib
21+
cryptomite/include

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
cmake_minimum_required(VERSION 3.22.1)
22

3-
project(extlib)
3+
project(cryptomite)
44

55
set(CMAKE_CXX_STANDARD 20)
66

77
add_subdirectory(src)
88

9-
add_subdirectory(extlib)
9+
add_subdirectory(cryptomite)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Extlib
1+
# cryptomite
22

33
An awesome random extraction library. Work in progress.
44

55

66
## Example Usage
77

88
```python
9-
from extlib.trevisan import Trevisan
9+
from cryptomite.trevisan import Trevisan
1010
from random import randint
1111

1212
n, m, max_eps = 1000, 200, 0.01

extlib/CMakeLists.txt renamed to cryptomite/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ FetchContent_Declare(
77
URL_HASH SHA256=c6160321dc98e6e1184cc791fbeadd2907bb4a0ce0e447f2ea4ff8ab56550913
88
)
99
FetchContent_MakeAvailable(pybind11)
10-
pybind11_add_module(_extlib MODULE pyextlib.cpp)
10+
pybind11_add_module(_cryptomite MODULE pycryptomite.cpp)
1111

12-
target_link_libraries(_extlib PUBLIC trevisan)
12+
target_link_libraries(_cryptomite PUBLIC trevisan)
1313

14-
install(TARGETS _extlib DESTINATION .)
14+
install(TARGETS _cryptomite DESTINATION .)
1515

1616
set(ignoreMe "${SKBUILD}")

cryptomite/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
__all__ = ['dodis', 'toeplitz', 'trevisan']
3+
4+
from cryptomite import dodis, toeplitz, trevisan

extlib/dodis.py renamed to cryptomite/dodis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from math import floor, log2
88
from typing import cast
99

10-
from extlib.utils import BitsT, conv, log_2, na_set
10+
from cryptomite.utils import BitsT, conv, log_2, na_set
1111

1212
__all__ = ['Dodis']
1313

extlib/pyextlib.cpp renamed to cryptomite/pycryptomite.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace py = pybind11;
88

99
// PYBIND11_MAKE_OPAQUE(std::vector<int>);
1010

11-
PYBIND11_MODULE(_extlib, m) {
11+
PYBIND11_MODULE(_cryptomite, m) {
1212
// optional module docstring
1313
m.doc() = "C++ Implementation of Randomness Extractors";
1414

extlib/toeplitz.py renamed to cryptomite/toeplitz.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from typing import cast
88

9-
from extlib.utils import BitT, BitsT, conv, log_2
9+
from cryptomite.utils import BitT, BitsT, conv, log_2
1010

1111
__all__ = ['Toeplitz']
1212

extlib/trevisan.py renamed to cryptomite/trevisan.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
__all__ = ['Trevisan']
77

8-
from extlib import _extlib
8+
from cryptomite import _cryptomite
99

1010

1111
class Trevisan:
@@ -29,8 +29,8 @@ def __init__(self, n: int, k: float, max_eps: float):
2929
max_eps : float
3030
The total worst case error.
3131
"""
32-
self.config = _extlib.TrevisanConfig(n, k, max_eps)
33-
self.ext = _extlib.Trevisan(self.config)
32+
self.config = _cryptomite.TrevisanConfig(n, k, max_eps)
33+
self.ext = _cryptomite.Trevisan(self.config)
3434

3535
def extract(self, source: list[bool], seed: list[bool]) -> list[bool]:
3636
"""

extlib/utils.py renamed to cryptomite/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from math import sqrt
77
from typing import Literal, Sequence
88

9-
from extlib._extlib import NTT, mul_vec
9+
from cryptomite._cryptomite import NTT, mul_vec
1010

1111
__all__ = ['is_prime', 'prime_facto', 'na_set', 'von_neumann']
1212

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
release = version = "[put version here]"
2121

2222

23-
project = 'extlib'
23+
project = 'cryptomite'
2424
copyright = '2021, 2022, Cambridge Quantum Computing Ltd.'
2525
author = 'Cambridge Quantum Team'
2626

Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
extlib package
1+
cryptomite package
22
==============
33

44
Submodules
55
----------
66

7-
extlib.dodis module
7+
cryptomite.dodis module
88
-------------------
99

10-
.. automodule:: extlib.dodis
10+
.. automodule:: cryptomite.dodis
1111
:members:
1212
:undoc-members:
1313
:show-inheritance:
1414

15-
extlib.toeplitz module
15+
cryptomite.toeplitz module
1616
----------------------
1717

18-
.. automodule:: extlib.toeplitz
18+
.. automodule:: cryptomite.toeplitz
1919
:members:
2020
:undoc-members:
2121
:show-inheritance:
2222

23-
extlib.trevisan module
23+
cryptomite.trevisan module
2424
----------------------
2525

26-
.. automodule:: extlib.trevisan
26+
.. automodule:: cryptomite.trevisan
2727
:members:
2828
:undoc-members:
2929
:show-inheritance:
3030

31-
extlib.utils module
31+
cryptomite.utils module
3232
----------------------
3333

34-
.. automodule:: extlib.utils
34+
.. automodule:: cryptomite.utils
3535
:members:
3636
:undoc-members:
3737
:show-inheritance:
3838

3939
Module contents
4040
---------------
4141

42-
.. automodule:: extlib
42+
.. automodule:: cryptomite
4343
:members:
4444
:undoc-members:
4545
:show-inheritance:

docs/examples/quantum-key-distribution.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"source": [
2828
"## Experimental CV-QKD\n",
2929
"Following the experimental results of the continuous variable protocol outlined in \\cite{jain2022practical}, we give pseudocode replicating the\n",
30-
"privacy amplification step of their experiment using our extractor library \\texttt{extlib}. This example can be easily adapted to any explicit QKD protocol. \n",
30+
"privacy amplification step of their experiment using our extractor library \\texttt{cryptomite}. This example can be easily adapted to any explicit QKD protocol. \n",
3131
"In this protocol, the quantum information is encoded into the amplitude and phase quadratures of the optical field. \n",
3232
"Alice encodes random bits, which she generates with a quantum random number generator (QRNG), by modulating the optical signal field to obtain coherent states.\n",
3333
"The QRNG used to generate random bits is based on \\cite{gabriel2010generator}, which consists of homodyne measurements of the vacuum state. \n",
@@ -44,7 +44,7 @@
4444
"\n",
4545
"The experimental implementation uses the $\\Toeplitz$ extractor for privacy amplification, with a raw key input length \n",
4646
"of $n = 1.738 \\times 10^9$, an output of $m = 41378264$ and therefore, a required seed length of $d = 1.738 \\times 10^9 + 41378263$.\n",
47-
"This privacy amplification step can be performed easily using our randomness extractor library \\texttt{extlib} as follows in Fig. \\ref{fig:pa}. \n"
47+
"This privacy amplification step can be performed easily using our randomness extractor library \\texttt{cryptomite} as follows in Fig. \\ref{fig:pa}. \n"
4848
]
4949
},
5050
{
@@ -54,7 +54,7 @@
5454
"metadata": {},
5555
"outputs": [],
5656
"source": [
57-
"import extlib\n",
57+
"import cryptomite\n",
5858
"def privacy_amplification(seed_bits, raw_key_bits, n = 1.738 * 10**9, m = 41378264):\n",
5959
" \"\"\" Perform privacy amplification for Practical \n",
6060
" CV-QKD with composable security.\n",
@@ -79,7 +79,7 @@
7979
" \"\"\"\n",
8080
" assert len(seed_bits) == n + m - 1\n",
8181
" assert len(raw_key_bits) == n\n",
82-
" toeplitz = extlib.Toeplitz(n, m)\n",
82+
" toeplitz = cryptomite.Toeplitz(n, m)\n",
8383
" return toeplitz.extract(seed_bits, raw_key_bits)"
8484
]
8585
},
@@ -96,7 +96,7 @@
9696
"\n",
9797
"Since the QRNG generating the seed bits is device-dependent the quality of the seed relies on the correct characterization and perfect modelling of the device.\n",
9898
"This opens the possibility that the seed bits may only be somewhat random.\n",
99-
"In this case, a shared secret key can still be generated, but each user must use the Toeplitz two-source (as opposed to seeded) randomness extractor extension from \\texttt{extlib} and adjust their output length accordingly. \n",
99+
"In this case, a shared secret key can still be generated, but each user must use the Toeplitz two-source (as opposed to seeded) randomness extractor extension from \\texttt{cryptomite} and adjust their output length accordingly. \n",
100100
"Below we show an example of this when considering the QRNG generated seed bits have a min-entropy rate of 0.99 (as opposed to 1 if it had been perfectly random). \n",
101101
"Let $\\boldsymbol{x}, \\boldsymbol{y}$ be the raw key bits and seed bits respectively, then the output length is adjusted to $m' = \\frac{1}{3} (41378264 - 2 (k_1 - n) + 2)$, where $k_1 = 0.99 \\times n$ is the seed min-entropy.\n",
102102
"\n",
@@ -108,7 +108,7 @@
108108
" \\State $m \\gets 41378264$ \\Comment{original output length}\n",
109109
" \\State $k_1 \\gets 0.99 \\times n$ \\Comment{calculate seed min-entropy} \n",
110110
" \\State $m' \\gets \\frac{1}{3} (41378264 - 2 (k_1 - n) + 2)$ \\Comment{new output length, given by \\eqref{eq:toeplits-q-2-params}}\n",
111-
" \\State \\textbf{return} \\texttt{extlib.Toeplitz(n, m).extract($\\bm{x}, \\bm{y}$)}\n",
111+
" \\State \\textbf{return} \\texttt{cryptomite.Toeplitz(n, m).extract($\\bm{x}, \\bm{y}$)}\n",
112112
" \\EndFunction\n",
113113
"\\end{algorithmic}\n",
114114
"\\end{algorithm}\n",
@@ -128,7 +128,7 @@
128128
" \\State $l \\gets \\max( 1 , \\Bigl\\lceil \\frac{\\log(m-r) - \\log(t-r)}{\\log(r) - log(r-1)} \\Bigr \\rceil)$ \n",
129129
" \\Comment{number of iterations of the weak design}\n",
130130
" \\State $d \\gets (l+1)\\times t^2$ \\Comment{seed length}\n",
131-
" \\State \\textbf{return} \\texttt{extlib.Trevisan(n, d, m).extract($\\bm{x}, \\bm{y}$)}\n",
131+
" \\State \\textbf{return} \\texttt{cryptomite.Trevisan(n, d, m).extract($\\bm{x}, \\bm{y}$)}\n",
132132
" \\EndFunction\n",
133133
"\\end{algorithmic}\n",
134134
"\\end{algorithm}"

docs/examples/quantum-random-number-generation.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"The experimental demonstration uses the Toeplitz extractor, which can give an output length of $\\geq 581294933$, given the\n",
3333
"extractor error is $\\leq 10^{-10}$. \n",
3434
"This requires a seed of $7081294934$ bits and for the raw randomness input length of $6.5 \\cdot 10^{9}$.\n",
35-
"This randomness extraction can be performed easily using our randomness extractor library \\texttt{extlib} as follows in Fig. \\ref{fig:re}. "
35+
"This randomness extraction can be performed easily using our randomness extractor library \\texttt{cryptomite} as follows in Fig. \\ref{fig:re}. "
3636
]
3737
},
3838
{
@@ -42,7 +42,7 @@
4242
"metadata": {},
4343
"outputs": [],
4444
"source": [
45-
"import extlib\n",
45+
"import cryptomite\n",
4646
"from math import log2, floor\n",
4747
"def randomness_extraction(seed_bits, raw_randomness, n = 6500000000, k = 581295000, epsilon = 10**-10 ):\n",
4848
" \"\"\" Perform randomness extraction for semi-DI QRNG. \n",
@@ -68,7 +68,7 @@
6868
" assert len(seed_bits) == n + m - 1\n",
6969
" assert len(raw_randomness) == n\n",
7070
" m = floor(k + 2*log2(epsilon))\n",
71-
" toeplitz = extlib.Toeplitz(n, m)\n",
71+
" toeplitz = cryptomite.Toeplitz(n, m)\n",
7272
" return toeplitz.extract(seed_bits, raw_randomness)"
7373
]
7474
},

docs/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
extlib
1+
cryptomite
22
======
33

44
This is a library. Stuff goes here.
55

66
.. code-block:: bash
77
8-
pip install extlib
8+
pip install cryptomite
99
1010
.. toctree::
1111
:caption: Toolkit
1212
:maxdepth: 4
1313

1414
intro
1515
glossary
16-
extlib
16+
cryptomite

docs/notebooks.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Examples
44
========
55

6-
In this section we give some explicit examples and pseudocode using \texttt{extlib} on recent experimental quantum cryptography demonstrations.
6+
In this section we give some explicit examples and pseudocode using \texttt{cryptomite} on recent experimental quantum cryptography demonstrations.
77
Since our package is easy to use, efficient and numerically precise, it is perfect for these applications.
88
We also highlight some extensions in these examples, whereby the results of these previous works could be improved by some combination of
99
(i) relaxing assumptions and (ii) speeding-up implementation.

extlib/__init__.py

-4
This file was deleted.
-257 Bytes
Binary file not shown.
-2.71 KB
Binary file not shown.
-2.44 KB
Binary file not shown.
-741 Bytes
Binary file not shown.
-741 Bytes
Binary file not shown.
-2.05 KB
Binary file not shown.

setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[metadata]
2-
name = extlib
2+
name = cryptomite
33
description = An awesome extractor library
44
long_description = file: README.md
55
long_description_content_type = text/markdown
@@ -25,7 +25,7 @@ classifiers =
2525

2626
[options]
2727
packages =
28-
extlib
28+
cryptomite
2929
install_requires =
3030
python_requires = >=3.8
3131

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
setup(
77
zip_safe=False,
8-
packages=["extlib"],
9-
cmake_install_dir="extlib",
8+
packages=["cryptomite"],
9+
cmake_install_dir="cryptomite",
1010
)

test/test_dodis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from extlib.dodis import Dodis
2+
from cryptomite.dodis import Dodis
33

44

55
dodis_testcases = [

test/test_toeplitz.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from extlib.toeplitz import Toeplitz
2+
from cryptomite.toeplitz import Toeplitz
33

44

55
toeplitz_testcases = [

0 commit comments

Comments
 (0)