Documentation

CslibFrontier.Crypto.Computational.Falcon.VerificationFrontend

Falcon v1.2 encoded verification frontend #

This module formalizes the byte-level frontend used by the NIST API of the NIST-selected Falcon Round 3 submission, version 1.2 ([FHK+20], Sections 3.7, 3.10 and 3.11). It parses the two-byte big-endian signature length, 40-byte salt, message and nonce-less signature; decodes the canonical compressed second signature polynomial; maps a supplied SHAKE-256 output prefix to a ring point by Algorithm 3's big-endian rejection rule; and then calls the algebraic verifier in Cslib.Crypto.Falcon.verify.

The pinned dependencies do not contain a SHAKE-256 implementation. Accordingly, verifyNistWithXof takes a function supplying an output prefix and passes it exactly the parsed salt ++ message. This exposes the interoperability boundary but does not implement or assume the cryptographic properties of SHAKE-256. The module is sourced to Falcon v1.2 and does not claim agreement with the still-developing FN-DSA / FIPS 206 standard.

Main definitions #

References #

@[reducible, inline]

A byte string, with each byte intrinsically restricted to the range 0,...,255.

Decode exactly n compressed Falcon coefficients from a byte string.

This is [FHK+20], Algorithm 18, specialized to the variable-length NIST signature from Section 3.11.6 and the submission's reference comp_decode: the sign and seven low magnitude bits precede a unary high part, magnitudes above 2047 and negative zero are rejected, all unused bits in the last byte must be zero, and a redundant whole zero byte is rejected.

Decode the compressed second signature polynomial for parameters P.

A successfully parsed Falcon v1.2 NIST signed message. The parser guarantees that salt has 40 bytes and that second came from the final nonce-less signature after its degree header was checked.

  • salt : ByteString

    The 40-byte random salt called nonce by the NIST API wrapper.

  • message : ByteString

    The message bytes between the salt and the trailing signature.

  • The canonically decompressed second signature polynomial.

The exact input injected into SHAKE-256 by Falcon verification: the 40-byte salt followed by the message.

Parse [FHK+20], Section 3.11.6's NIST API signed-message aggregate.

The first two bytes give the trailing signature length in big-endian order. They are followed by the 40-byte salt, the message, and a signature whose header is 0010nnnn; the low nibble is accepted exactly when P.n = 2^nnnn. The remaining signature bytes are decoded canonically by decompress.

Apply [FHK+20], Algorithm 3's rejection rule to a finite SHAKE-256 output prefix.

Success returns the first n accepted coefficients. Each consecutive byte pair is interpreted big-endian as t; values below ⌊2^16 / q⌋ q contribute t mod q and the others are discarded. The result is none when q is outside the source range, n = 0, or the prefix has too few accepted pairs.

Interpret enough accepted coefficients from a finite XOF output prefix as the Falcon hash point in ℤ_q[x]/(x^n + 1).

Run the Falcon v1.2 NIST encoded verification frontend with an explicit XOF-prefix supplier.

On a successfully parsed aggregate, xof is called on exactly salt ++ message; its output is processed by Algorithm 3 and the result and decoded s₂ are passed to verify. Malformed input or an insufficient XOF prefix is rejected. Instantiating xof with a correct SHAKE-256 implementation is a separate obligation.