Activity Overview
Commits and releases over time
- Commits
- Releases
- Authors
Repository Explorer
No repositories match that filter.
23 commits in all time
Jun 24, 2026 19:34 – Sep 22, 2026 19:34 UTC
Add a portable KAT format, and a tool to produce and check it
The committed KAT arrays derive each key from a seeded PRNG, which no other implementation can reproduce. tests/kat_tool re-exports the same vectors with keys, public keys and messages as literal bytes, so a port in another language needs only a signer. make kat regenerate the committed files make check-kat re-derive every record and compare (added to CI) make kat-full write the exhaustive 512-record sets See kat/README.md for the format.
e753f8d4
pull/18/head
7/1,640 ++ 2 --
Reject malformed deterministic public key headers
falcon_det{1024,512}_pubkey_coeffs skipped the first byte of the key and
decoded the remaining bytes without ever looking at it, so a buffer whose
header byte is wrong (a key for a different logn, or bytes that are not a
Falcon public key at all) was unpacked as though it were valid, returning 0
and a coefficient vector that does not correspond to any det key. The
verify entry points do not have this gap: they go through falcon_verify,
which checks the header before touching the rest of the key. Check the
byte here the same way and return FALCON_ERR_FORMAT, which the header's
"non-zero error code if pubkey is invalid" contract already promises.
2d833e8c
pull/19/head
3/9 ++ 0 --
Link only required deterministic variants
deterministic1024.o and deterministic512.o were in the shared OBJ list, so every binary linked both, including test_falcon and speed, which use neither, and each KAT driver, which uses only its own variant. Give each test_deterministic<n> binary its own deterministic<n>.o prerequisite and keep the generic objects in OBJ, so a binary pulls in only the variant it exercises. The objects still have their own rules and "clean" still removes them.
c9b466b7
pull/19/head
1/6 ++ 6 --
Makefile: complete the deterministic*.o header prerequisites
deterministic{1024,512}.c include inner.h (and, through it, config.h
and fpr.h), but their object rules named only deterministic.h and
falcon.h, so an edit to e.g. FALCON_FPEMU in config.h left stale
deterministic objects in an incremental build. List the same headers
as the other object rules.
ec165724
pull/19/head
1/2 ++ 2 --
deterministic.h: document the get_salt_version length precondition
falcon_det{1024,512}_get_salt_version take no length parameter and
read the signature's second byte unconditionally, unlike the other
entry points, which validate their input's length or take a fixed-size
format. Spell out the resulting >= 2 bytes precondition so callers
handling untrusted input know to check it (as the Go binding does).
a8b7f19a
pull/19/head
1/3 ++ 1 --
tests: avoid the zero-length VLA in the KAT drivers
test_inner declared its message buffer as uint8_t data[data_len], and the KAT loop starts at data_len = 0; a zero-length variable-length array is undefined behavior (C11 6.7.6.2p5) and trips -fsanitize=vla-bound before the first KAT is checked. data_len is bounded by NUM_KATS, so use a fixed-size buffer of that length.
91b6c15b
pull/19/head
2/8 ++ 2 --
falcon.go: document and pin the inline cgo buffer arguments
The per-call-site "if len(b) == 0 { NULL } else { &b[0] }" branches
look like they should be a shared helper, but the duplication is
load-bearing: cgo enforces its pointer-passing rules against the
syntactic form of the call arguments, so an inline &b[0] is checked
against just the slice's backing array, while the same pointer
returned from a helper is resolved to its entire containing
allocation -- and panics when the caller's slice aliases a struct
that also holds Go pointers, exactly what TestPointerToPointer
constructs. Say so where the next reader would reach for the helper,
and add the det512 mirror of that regression test, which the copied
det512 bindings were missing.
58c12164
pull/19/head
2/82 ++ 0 --
tests: print the CT salt version in its failure diagnostic
The CT-format salt-version check compares vct but its error message printed the stale v from the earlier compressed-format check, so a failure would report the (correct) compressed version instead of the offending CT one.
e4cc12f8
pull/19/head
2/2 ++ 2 --
deterministic.c.tmpl: align hash_to_point_ct's temporary buffer
hash_to_point_coeffs declared its scratch space as a uint8_t array, but Zf(hash_to_point_ct) documents that tmp[] must have 16-bit alignment (it stores uint16_t through it). Declare the buffer as uint16_t so the alignment holds by construction; on strict-alignment targets the byte array was undefined behavior. No output change: the KATs are unaffected.
39428b70
pull/19/head
3/12 ++ 6 --
deterministic.h: parenthesize the signature-size macros
FALCON_DET{1024,512}_SIG_COMPRESSED_MAXSIZE and _SIG_CT_SIZE expanded
to an unparenthesized "...-40+1", which miscomputes inside a larger
expression such as FALCON_DET512_SIG_CT_SIZE * 2. All existing uses
are value-unchanged.
34b3f3ef
pull/19/head
1/4 ++ 4 --
Make deterministic source generation failure-safe
scripts/gen_deterministic.sh built each deterministic<n>.c with a single pipeline redirected straight into the target. Under "set -e" a pipeline's status is that of its last command, so a failing "cc -E" (a #error or syntax error in the template) was masked by unexpand: the script exited 0 and overwrote the target with whatever cpp had emitted, and because the Makefile regenerates only when the template is newer, the broken file then counted as up to date. Run the stages one at a time into a private mktemp directory so every exit status is seen, generate all requested files there before moving any into place, and reject missing or non-numeric arguments up front. A failure now leaves the existing sources untouched. Installing with mv rather than redirection has its own edge cases, so tighten those too. Reject n values with a leading zero and duplicate n, since either would produce a staged file name that does not correspond one-to-one with the requested targets. Refuse to run when a target path is a directory: mv would otherwise place the generated file inside it and report success without replacing the requested path. Finally install all staged files with a single mv invocation; each replacement is still atomic because the staging directory is on the destination filesystem.
03f7403f
pull/18/head
1/64 ++ 30 --
Merge 4f4ae0e98b7d1f6b007cf9db21e7df3a475f9c4f into 956d9bc0ab8c503e0133259488cd8e0aedc0986d
144b40b5
pull/15/merge
4/322 ++ 12 --
Add FALCON-DET512 Go bindings
Exposes the new det512 C API (n=512) as a parallel set of Det512-prefixed
types and functions alongside the existing unprefixed (det1024) bindings,
which remain unchanged. Mirrors the existing binding style.
New exports:
- Constants: Det512PublicKeySize, Det512PrivateKeySize,
Det512CurrentSaltVersion, Det512CTSignatureSize, Det512SignatureMaxSize,
Det512N (= 512).
- Types: Det512PublicKey, Det512PrivateKey, Det512CompressedSignature,
Det512CTSignature.
- Functions: Det512GenerateKey, Det512S1Coefficients,
Det512HashToPointCoefficients.
- Methods: Det512PrivateKey.SignCompressed;
Det512CompressedSignature.{ConvertToCT, SaltVersion};
Det512CTSignature.{SaltVersion, S2Coefficients};
Det512PublicKey.{Verify, VerifyCTSignature, Coefficients}.
Adds Go tests mirroring the existing det1024 suite: TestKATs512 verifies
compressed signing against the reference known-answer vectors, TestDet512
covers the keygen/sign/verify round trip (compressed and CT), salt version,
bad-message and bad-key rejection, and h/c/s1/s2 coefficient recomputation,
plus signature-size, nil-message, distinct-seed, nil-signature, nil-seed,
and salt-version edge cases.
bd898d21
pull/18/head
2/516 ++ 0 --