Lines Matching refs:DEFAULT_BLK_SZ

20 #define DEFAULT_BLK_SZ 16  macro
41 unsigned char rand_data[DEFAULT_BLK_SZ];
42 unsigned char last_rand_data[DEFAULT_BLK_SZ];
43 unsigned char DT[DEFAULT_BLK_SZ];
44 unsigned char I[DEFAULT_BLK_SZ];
45 unsigned char V[DEFAULT_BLK_SZ];
84 unsigned char tmp[DEFAULT_BLK_SZ]; in _get_more_prng_bytes()
91 hexdump("Input DT: ", ctx->DT, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
92 hexdump("Input I: ", ctx->I, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
93 hexdump("Input V: ", ctx->V, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
106 memcpy(tmp, ctx->DT, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
108 hexdump("tmp stage 0: ", tmp, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
117 xor_vectors(ctx->I, ctx->V, tmp, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
118 hexdump("tmp stage 1: ", tmp, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
127 DEFAULT_BLK_SZ)) { in _get_more_prng_bytes()
141 DEFAULT_BLK_SZ); in _get_more_prng_bytes()
148 DEFAULT_BLK_SZ); in _get_more_prng_bytes()
150 hexdump("tmp stage 2: ", tmp, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
163 for (i = DEFAULT_BLK_SZ - 1; i >= 0; i--) { in _get_more_prng_bytes()
172 hexdump("Output DT: ", ctx->DT, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
173 hexdump("Output I: ", ctx->I, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
174 hexdump("Output V: ", ctx->V, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
175 hexdump("New Random Data: ", ctx->rand_data, DEFAULT_BLK_SZ); in _get_more_prng_bytes()
201 if (nbytes < DEFAULT_BLK_SZ) in get_prng_bytes()
203 byte_count = DEFAULT_BLK_SZ; in get_prng_bytes()
217 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) { in get_prng_bytes()
228 if (byte_count < DEFAULT_BLK_SZ) { in get_prng_bytes()
230 while (ctx->rand_data_valid < DEFAULT_BLK_SZ) { in get_prng_bytes()
243 for (; byte_count >= DEFAULT_BLK_SZ; byte_count -= DEFAULT_BLK_SZ) { in get_prng_bytes()
244 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) { in get_prng_bytes()
253 memcpy(ptr, ctx->rand_data, DEFAULT_BLK_SZ); in get_prng_bytes()
254 ctx->rand_data_valid += DEFAULT_BLK_SZ; in get_prng_bytes()
255 ptr += DEFAULT_BLK_SZ; in get_prng_bytes()
292 memcpy(ctx->V, V, DEFAULT_BLK_SZ); in reset_prng_context()
294 memcpy(ctx->V, DEFAULT_V_SEED, DEFAULT_BLK_SZ); in reset_prng_context()
297 memcpy(ctx->DT, DT, DEFAULT_BLK_SZ); in reset_prng_context()
299 memset(ctx->DT, 0, DEFAULT_BLK_SZ); in reset_prng_context()
301 memset(ctx->rand_data, 0, DEFAULT_BLK_SZ); in reset_prng_context()
302 memset(ctx->last_rand_data, 0, DEFAULT_BLK_SZ); in reset_prng_context()
304 ctx->rand_data_valid = DEFAULT_BLK_SZ; in reset_prng_context()
368 const u8 *key = seed + DEFAULT_BLK_SZ; in cprng_reset()
371 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ) in cprng_reset()
374 if (slen >= (2 * DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ)) in cprng_reset()
397 u8 rdata[DEFAULT_BLK_SZ]; in fips_cprng_reset()
398 const u8 *key = seed + DEFAULT_BLK_SZ; in fips_cprng_reset()
403 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ) in fips_cprng_reset()
416 rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, 0); in fips_cprng_reset()
417 prng->rand_data_valid = DEFAULT_BLK_SZ; in fips_cprng_reset()
427 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,
441 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,