Lines Matching +full:fips +full:- +full:140 +full:- +full:2
2 * DRBG based on NIST SP800-90A
12 * 2. Redistributions in binary form must reproduce the above copyright
23 * the restrictions contained in a BSD-style copyright.)
52 #include <linux/fips.h>
60 * SP800-90A requires the concatenation of different data. To avoid copying
76 string->buf = buf; in drbg_string_fill()
77 string->len = len; in drbg_string_fill()
78 INIT_LIST_HEAD(&string->list); in drbg_string_fill()
115 /* Number of RNG requests since last reseed -- 10.1.1.1 1c) */
133 unsigned char *prev; /* FIPS 140-2 continuous test value */
144 if (drbg && drbg->core) in drbg_statelen()
145 return drbg->core->statelen; in drbg_statelen()
151 if (drbg && drbg->core) in drbg_blocklen()
152 return drbg->core->blocklen_bytes; in drbg_blocklen()
158 if (drbg && drbg->core) in drbg_keylen()
159 return (drbg->core->statelen - drbg->core->blocklen_bytes); in drbg_keylen()
165 /* SP800-90A requires the limit 2**19 bits, but we return bytes */ in drbg_max_request_bytes()
171 /* SP800-90A requires 2**35 bytes additional info str / pers str */ in drbg_max_addtl()
174 * SP800-90A allows smaller maximum numbers to be returned -- we in drbg_max_addtl()
175 * return SIZE_MAX - 1 to allow the verification of the enforcement in drbg_max_addtl()
178 return (SIZE_MAX - 1); in drbg_max_addtl()
186 /* SP800-90A requires 2**48 maximum requests before reseeding */ in drbg_max_requests()
194 * @drng DRBG handle -- see crypto_rng_get_bytes
195 * @outbuf output buffer -- see crypto_rng_get_bytes
196 * @outlen length of output buffer -- see crypto_rng_get_bytes
207 return crypto_rng_generate(drng, addtl->buf, addtl->len, in crypto_drbg_get_bytes_addtl()
218 * @drng DRBG handle -- see crypto_rng_get_bytes
219 * @outbuf output buffer -- see crypto_rng_get_bytes
220 * @outlen length of output buffer -- see crypto_rng_get_bytes
233 crypto_rng_set_entropy(drng, test_data->testentropy->buf, in crypto_drbg_get_bytes_addtl_test()
234 test_data->testentropy->len); in crypto_drbg_get_bytes_addtl_test()
235 return crypto_rng_generate(drng, addtl->buf, addtl->len, in crypto_drbg_get_bytes_addtl_test()
245 * @drng DRBG handle -- see crypto_rng_reset
257 crypto_rng_set_entropy(drng, test_data->testentropy->buf, in crypto_drbg_reset_test()
258 test_data->testentropy->len); in crypto_drbg_reset_test()
259 return crypto_rng_reset(drng, pers->buf, pers->len); in crypto_drbg_reset_test()
265 #define DRBG_HASH ((drbg_flag_t)1<<2)