pub enum Error {
InsufficientEntropy,
RequestTooLarge,
AdditionalInputTooLong,
PersonalizationTooLong,
ReseedRequired,
InvalidLength,
}Expand description
Errors returned by the DRBG mechanisms (SP 800-90A §9).
Each mechanism re-exports this single enum; the variants map onto the
ERROR_FLAG / length-check conditions of §10 and the reseed-count
exhaustion of §9.3.3.
Variants§
InsufficientEntropy
The instantiate/reseed entropy input is shorter than the mechanism’s
minimum (security_strength bits, SP 800-90A §8.6.3 and the tables
of §10). Also raised, for CTR_DRBG without a derivation function,
when the entropy input length is not exactly seedlen (§10.2.1.3.1).
RequestTooLarge
A single generate request asked for more than max_number_of_bits_per_request
(SP 800-90A §10, tables 2/3: 2^19 bits = 65 536 octets).
AdditionalInputTooLong
The additional_input supplied to generate/reseed exceeds
max_additional_input_length (2^35 bits; enforced here as a byte
bound to keep the length fields in range).
PersonalizationTooLong
The personalization string exceeds max_personalization_string_length
(SP 800-90A §10, 2^35 bits).
ReseedRequired
The reseed counter reached reseed_interval: a reseed is required
before the next generate (SP 800-90A §9.3.3, step 1 → status
“Reseed required”). The caller must call reseed.
InvalidLength
A CTR_DRBG no-df key length that is not one of the AES key sizes,
or a personalization/additional-input length that does not match
seedlen in no-df mode (SP 800-90A §10.2.1.3.1 / §10.2.1.5.1).