Skip to content

Commit

Permalink
Add Falcon-Padded
Browse files Browse the repository at this point in the history
  • Loading branch information
James-E-A committed Feb 28, 2024
1 parent d7d6a17 commit 7564961
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
21 changes: 16 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ KEMs

McEliece, Kyber, and HQC are currently provided, all with the same interface.::

# Available: hqc_128, hqc_192, hqc_256,
# kyber512, kyber768, kyber1024,
# mceliece348864, mceliece460896,
# mceliece6688128, mceliece6960119, mceliece8192128
from pqc.kem import mceliece6960119 as kemalg
Expand Down Expand Up @@ -36,6 +40,14 @@ Signature Algorithms

SPHINCS+, Dilithium, and Falcon are provided, all with the same interface.::

# Supported: dilithium2, dilithium3, dilithium5,
# falcon_512, falcon_512_padded, falcon_1024, falcon_1024_padded,
# sphincs_sha2_128f_simple, sphincs_sha2_128s_simple,
# sphincs_shake_128f_simple, sphincs_shake_128s_simple,
# sphincs_sha2_192f_simple, sphincs_sha2_192s_simple,
# sphincs_shake_192f_simple, sphincs_shake_192s_simple,
# sphincs_sha2_256f_simple, sphincs_sha2_256s_simple,
# sphincs_shake_256f_simple, sphincs_shake_256s_simple
from pqc.sign import sphincs_shake_256s_simple as sigalg
Expand All @@ -53,12 +65,11 @@ SPHINCS+, Dilithium, and Falcon are provided, all with the same interface.::
sigalg.verify(sig, MY_MESSAGE, pk)

Regarding SPHINCS+: the Simple version is included; the Robust version is is not;
SHA256 and SHAKE256 are included; Haraka is not. These decisions are all inherited
from PQClean; I don't know much about their rationale.
SHA256 and SHAKE256 are included; Haraka is not. See https://github.com/PQClean/PQClean/discussions/548#discussioncomment-8565116
for more information.

Regarding Falcon: the Compressed version is included.
The Padded version is not included, but TODO as soon as upstream adds it;
the CT version is probably not going to be included.
Regarding Falcon: the Compressed and Padded versions are included, and are able to
``verify()`` each others' signatures. The CT version is not currently planned.

Development
===========
Expand Down
3 changes: 3 additions & 0 deletions cffi_modules/falcon_1024_padded_clean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from cffi_modules._falcon_cffi_maker import make_falcon_ffi

ffi = make_falcon_ffi('./Modules/PQClean/crypto_sign/falcon-1024-padded/clean')
3 changes: 3 additions & 0 deletions cffi_modules/falcon_512_padded_clean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from cffi_modules._falcon_cffi_maker import make_falcon_ffi

ffi = make_falcon_ffi('./Modules/PQClean/crypto_sign/falcon-512-padded/clean')
17 changes: 17 additions & 0 deletions pqc/sign/falcon_1024_padded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from .._common import _SigAlg

from pathlib import Path
import os


if os.environ.get('LICENSED_FALCON', '0') == '0':
# fmt: off
from .._util import patent_notice
patent_notice(['US7308097B2'],
'the Falcon cryptosystem', 2,
['https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/selected-algos-2022/final-ip-statements/Falcon-Statements-final.pdf#page=20']
)
# fmt: on


_SigAlg._init_module(Path(__file__).stem, globals())
17 changes: 17 additions & 0 deletions pqc/sign/falcon_512_padded.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from .._common import _SigAlg

from pathlib import Path
import os


if os.environ.get('LICENSED_FALCON', '0') == '0':
# fmt: off
from .._util import patent_notice
patent_notice(['US7308097B2'],
'the Falcon cryptosystem', 2,
['https://csrc.nist.gov/csrc/media/Projects/post-quantum-cryptography/documents/selected-algos-2022/final-ip-statements/Falcon-Statements-final.pdf#page=20']
)
# fmt: on


_SigAlg._init_module(Path(__file__).stem, globals())
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = 'pypqc'
version = '0.0.7.0-a0'
version = '0.0.7.0-a1'
description = 'Python bindings for the "PQClean" post-quantum cryptography library.'
readme = 'README.rst'
license.file = 'COPYING.rst'
Expand Down

0 comments on commit 7564961

Please sign in to comment.