This is a private repository implementing the signature scheme Falcon (https://falcon-sign.info/). Falcon stands for FAst Fourier Lattice-based COmpact signatures over NTRU
This repository contains the following files (in order of dependency):
- generate_constants.sage contains the code which was used to generate the constants used in this project
- common.py contains shared functions and constants
- fft_constants.py contains precomputed constants used in the FFT
- ntt_constants.py contains precomputed constants used in the NTT
- fft.py contains a stand-alone implementation of the FFT over R[x] / (xn + 1)
- ntt.py contains a stand-alone implementation of the NTT over Zq[x] / (xn + 1)
- ntrugen.py generate polynomials f,g,F,G in Z[x] / (xn + 1) such that f G - g F = q
- sampler.py implements a Gaussian sampler over the integers
- ffsampling.py implements the fast Fourier sampling algorithm
- falcon.py implements Falcon
- test.py implements tests to check that everything is properly implemented
- Generate a secret key sk = SecretKey(n)
- Generate the corresponding public key pk = PublicKey(sk)
- Now we can sign messages:
- To plainly sign a message m: sig = sk.sign(m)
- To sign a message m with a pre-chosen 320-bit integer salt: sig = sk.sign(m, salt)
- We can also verify signatures: pk.verify(m, sig)
- Compress and decompress
- Document all the docstrings
- Thomas Prest ([email protected])
This is work in progress. It is not to be considered suitable for production. It can, to some extent, be considered reference code, but the "true" reference code of Falcon is on https://falcon-sign.info/.
If you find errors or flaw, I will be very happy if you report them to me at the provided address.
MIT