falcon library
Falcon — a web-safe Dart implementation of the post-quantum signature
scheme (faithful port of the reference tprest/falcon.py).
import 'package:locality_falcon/falcon.dart';
final falcon = Falcon(512);
final (sk, vk) = falcon.keygen();
final sig = falcon.sign(sk, utf8.encode('hello'));
assert(falcon.verify(vk, utf8.encode('hello'), sig));
Classes
- ChaCha20
- Deterministic ChaCha20-based PRNG used by Falcon during signing.
- Falcon
-
The Falcon signature scheme for a given degree
n(a power of two, 2..1024). - FalconParams
-
Falcon parameter sets and protocol constants, copied verbatim from the
reference
falcon.py. - SecretKey
-
A Falcon secret key: the NTRU polynomials (f, g, F, G), the FFT of the
lattice basis B0 = [
g, -f,G, -F], and the normalized ffLDL tree used for fast Fourier sampling during signing.
Extensions
- FalconKeygen on Falcon
- Key generation concern of Falcon.
- FalconSign on Falcon
- Signing concern of Falcon.
- FalconVerify on Falcon
- Verification concern of Falcon.
Constants
-
falconParams
→ const Map<
int, FalconParams> - falconQ → const int
- The integer modulus used in Falcon.
- headLen → const int
- Bytelengths of the signing header, salt and per-signature seed.
-
logn
→ const Map<
int, int> - log2(n) per parameter set, used in the signature header byte (0x30 + logn).
- saltLen → const int
- seedLen → const int
Functions
-
secureRandomBytes(
int n) → Uint8List - Default RandomBytes: cryptographically secure, backed by Random.secure.
Typedefs
- RandomBytes = Uint8List Function(int n)
-
A source of (pseudo-)randomness: returns exactly
nfresh bytes.