-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add figures and update docs * update code annotation
- Loading branch information
1 parent
39f9069
commit e0f0013
Showing
12 changed files
with
37 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,16 @@ | ||
Selecting a Randomness Extractor | ||
================================ | ||
In the following, we use the notation :math:`n_1, n_2` to denote the length and :math:`k_1, k_2` to denote the :term:`min-entropy` of | ||
any first or second input string respectively. Additionally, :math:`m` denotes the length of an output string, :math:`\epsilon` | ||
the extractor error and :math:`O(.)` denotes the asymptotic behaviour of a function. | ||
In general, the choice of randomness extractor depends on the scenario in which it is to be used and, it is not always clear which extractor is best suited to a given scenario. | ||
In this section, we (informally) help solve this problem, based on the section 'Overview of Extractor Library' from Cryptomite's accompanying paper (see :ref:`For2024`). | ||
We use the notation :math:`n_1, n_2` to denote the length and :math:`k_1, k_2` to denote the :term:`min-entropy` of any first or second input string respectively. | ||
Additionally, :math:`m` denotes the length of an output string, :math:`\epsilon` the extractor error and :math:`O(.)` denotes asymptotic quantities. | ||
|
||
:py:class:`.Circulant` | ||
------------------ | ||
The Circulant extractor is a :term:`seeded randomness extractor`, meaning that it requires two independent bit | ||
strings of randomness, where one is already (near-)perfectly random (called a seed). | ||
It requires the weak input to be of length :math:`n_1 = n_2 - 1`, where the length of the seed :math:`n_2` is prime | ||
and outputs approximately :math:`m \approx k_1 + k_2 - n_1` when considering classical side information or in the quantum product-source model | ||
and :math:`m \approx \frac{1}{5}(k_1 + k_2 - n_1)`. | ||
Our implementation of this extractor has near-linear computational complexity. | ||
.. image:: figures/extractor_flow_chart.png | ||
:width: 600 | ||
|
||
This extractor is best suited to scenarios where a seeded extractor is required in both the classical and quantum side information setting. | ||
Note: there may be a small gain to be made by analysing the extractors individually if sufficiently motivated, but this flow-chart gives a good, general, approach to follow. | ||
The individual extractor parameters are given in the following table: | ||
|
||
:py:class:`.Dodis` | ||
------------------ | ||
The Dodis extractor is a :term:`2-source randomness extractor`, meaning that it requires two independent bit | ||
strings of randomness that only 'contain' entropy (as opposed to one or both being fully entropic). | ||
It requires equal length inputs (:math:`n_1 = n_2`) that are prime with 2 as a primitive root (see :py:func:`.na_set` in glossary) | ||
and outputs approximately :math:`m \approx k_1 + k_2 - n_1` when considering classical side information and :math:`m \approx \frac{1}{5}(k_1 + k_2 - n_1)`. | ||
Our implementation of this extractor has near-linear computational complexity. | ||
|
||
This extractor is best suited to scenarios where a two-source extractor is required, | ||
or a computationally efficient extractor considering classical side information only (then Dodis can be | ||
used as a seeded extractor, giving approximately the same output length as Toeplitz, whilst reducing required seed size.) | ||
|
||
:py:class:`.Toeplitz` | ||
--------------------- | ||
The Toeplitz extractor is a :term:`seeded randomness extractor`, meaning that it requires two independent bit | ||
strings of randomness, where one is already (near-)perfectly random (called a seed). | ||
It requires a seed length of :math:`n_2 = n_1 + m - 1` | ||
and outputs approximately :math:`m \approx k_1` when considering classical or quantum side information. | ||
Our implementation of this extractor has near-linear computational complexity. | ||
We also offer a two-source extension of this extractor, whereby the error scales with :math:`\epsilon \rightarrow 2^{n_2 - k_2} \epsilon`, | ||
where :math:`n_2-k_2` is the difference between the seed length and the seed min-entropy. | ||
|
||
This extractor is best suited to scenarios where a computationally efficient seeded extractor is needed and security | ||
against quantum side information. | ||
|
||
:py:class:`.Trevisan` | ||
--------------------- | ||
The Trevisan extractor is a :term:`seeded randomness extractor`, meaning that it requires two independent bit | ||
strings of randomness, where one is already (near-)perfectly random (called a seed). | ||
It requires a seed length of :math:`n_2 = O(\log_2 (n_1))` and outputs approximately :math:`m \approx k_1` when considering classical or quantum side information. | ||
Our implementation of this extractor has :math:`O(n_1^2)` computational complexity. | ||
We also offer a two-source extension of this extractor, whereby the error scales with :math:`\epsilon \rightarrow 2^{n_2 - k_2} \epsilon`, | ||
where :math:`n_2-k_2` is the difference between the seed length and the seed min-entropy. | ||
|
||
This extractor is best suited to scenarios where only a seeded extractor is needed, but only a | ||
small (in terms of length) seed is available as a resource. | ||
|
||
:py:func:`.von_neumann` | ||
----------------------- | ||
The Von-Neumann extractor is a :term:`deterministic randomness extractor`, meaning that it requires a | ||
single input string of randomness that has some known (and specific) structure. | ||
Our implementation of this extractor has linear computational complexity. | ||
|
||
This extractor is best suited to scenarios where a fast extractor is needed and the input has more structure than simply min-entropy. | ||
.. image:: figures/Table.png | ||
:width: 600 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
Performance | ||
========== | ||
|
||
To demonstrate the capabilities of :py:mod:`cryptomite`, we perform some benchmarking on a MacBook Pro personal laptop (with 2 GHz quad-core Intel i5 processor with 16GB RAM). | ||
The varying degrees of computational efficiency for the extractors of :py:mod:`cryptomite` are evidenced in the following Figure. | ||
To demonstrate the capabilities of :py:mod:`Cryptomite`, we perform some bench-marking on a MacBook Pro personal laptop (with 2 GHz quad-core Intel i5 processor with 16GB RAM). | ||
The speed (throughput) for the standard versions of :py:mod:`Cryptomite` extractors are evidenced in the following figure. | ||
This testing is performed assuming that the min-entropy of the weak input is :math:`k_1 = n_1 / 2`. | ||
|
||
.. image:: figures/performance.png | ||
:width: 600 | ||
|
||
Some observations performance observations are: | ||
|
||
* The :py:func:`.von_neumann` extractor is able to output at speeds above 7Mbit/s. | ||
* The :py:class:`.Circulant`, :py:class:`.Dodis` and :py:class:`.Toeplitz` extractors are able to output at speeds of up to 1Mbit/s. The generation speed is faster for shorter input lengths. | ||
* The :py:class:`.Circulant`, :py:class:`.Dodis` and :py:class:`.Toeplitz` extractors are able to output at speeds of up to 0.5Mbit/s. The generation speed is faster for shorter input lengths. | ||
* The :py:class:`.Trevisan` extractor can generate output at speeds comparable to the :py:class:`.Toeplitz` and :py:class:`.Dodis` extractors only when the input size is extremely short. | ||
* The :py:class:`.Trevisan` extractor unable to generate a non-vanishing bits/second rate for input lengths greater than approximately 30,000. |