Crate fn_dsa_comm

Source
Expand description

This crate contains utility functions which are used by FN-DSA for key pair generation, signing, and verifying. It is not meant to be used directly.

Modules§

codec
Encoding/decoding primitives.
mq
Computations with polynomials modulo X^n+1 and modulo q = 12289.
mq_avx2
Specialized versions of mq which use AVX2 opcodes (on x86 CPUs).
shake
SHAKE implementation.

Structs§

DomainContext
When a message is signed or verified, it is accompanied with a domain separation context, which is an arbitrary sequence of bytes of length at most 255. Such a context is wrapped in a DomainContext structure.
HashIdentifier
The message for which a signature is to be generated or verified is pre-hashed by the caller and provided as a hash value along with an identifier of the used hash function. The identifier is normally an encoded ASN.1 OID. A special identifier is used for “raw” messages (i.e. not pre-hashed at all); it uses a single byte of value 0x00.
RngError
Error type of random number generators

Constants§

DOMAIN_NONE
Empty domain separation context.
FN_DSA_LOGN_512
Symbolic constant for FN-DSA with degree 512 (logn = 9).
FN_DSA_LOGN_1024
Symbolic constant for FN-DSA with degree 1024 (logn = 10).
HASH_ID_ORIGINAL_FALCON
Hash function identifier: original Falcon design.
HASH_ID_RAW
Hash function identifier: none.
HASH_ID_SHA3_256
Hash function identifier: SHA3-256
HASH_ID_SHA3_384
Hash function identifier: SHA3-384
HASH_ID_SHA3_512
Hash function identifier: SHA3-512
HASH_ID_SHA256
Hash function identifier: SHA-256
HASH_ID_SHA384
Hash function identifier: SHA-384
HASH_ID_SHA512
Hash function identifier: SHA-512
HASH_ID_SHA512_256
Hash function identifier: SHA-512-256
HASH_ID_SHAKE128
Hash function identifier: SHAKE128
HASH_ID_SHAKE256
Hash function identifier: SHAKE256

Traits§

CryptoRng
A marker trait used to indicate that an RngCore or BlockRngCore implementation is supposed to be cryptographically secure.
PRNG
Trait for a deterministic pseudorandom generator.
RngCore
The core of a random number generator.

Functions§

has_avx2
Do a rutime check for AVX2 support (x86 and x86_64 only).
hash_to_point
Hash a message into a polynomial modulo q = 12289.
sign_key_size
Get the size (in bytes) of a signing key for the provided degree (degree is n = 2^logn, with 2 <= logn <= 10).
signature_size
Get the size (in bytes) of a signature for the provided degree (degree is n = 2^logn, with 2 <= logn <= 10).
vrfy_key_size
Get the size (in bytes) of a verifying key for the provided degree (degree is n = 2^logn, with 2 <= logn <= 10).