Searched refs:DEFAULT_BLK_SZ (Results 1 - 1 of 1) sorted by relevance
/linux-4.1.27/crypto/ |
H A D | ansi_cprng.c | 27 #define DEFAULT_BLK_SZ 16 macro 48 unsigned char rand_data[DEFAULT_BLK_SZ]; 49 unsigned char last_rand_data[DEFAULT_BLK_SZ]; 50 unsigned char DT[DEFAULT_BLK_SZ]; 51 unsigned char I[DEFAULT_BLK_SZ]; 52 unsigned char V[DEFAULT_BLK_SZ]; 85 * Returns DEFAULT_BLK_SZ bytes of random data per call 91 unsigned char tmp[DEFAULT_BLK_SZ]; _get_more_prng_bytes() 98 hexdump("Input DT: ", ctx->DT, DEFAULT_BLK_SZ); _get_more_prng_bytes() 99 hexdump("Input I: ", ctx->I, DEFAULT_BLK_SZ); _get_more_prng_bytes() 100 hexdump("Input V: ", ctx->V, DEFAULT_BLK_SZ); _get_more_prng_bytes() 113 memcpy(tmp, ctx->DT, DEFAULT_BLK_SZ); _get_more_prng_bytes() 115 hexdump("tmp stage 0: ", tmp, DEFAULT_BLK_SZ); _get_more_prng_bytes() 124 xor_vectors(ctx->I, ctx->V, tmp, DEFAULT_BLK_SZ); _get_more_prng_bytes() 125 hexdump("tmp stage 1: ", tmp, DEFAULT_BLK_SZ); _get_more_prng_bytes() 134 DEFAULT_BLK_SZ)) { _get_more_prng_bytes() 148 DEFAULT_BLK_SZ); _get_more_prng_bytes() 155 DEFAULT_BLK_SZ); _get_more_prng_bytes() 157 hexdump("tmp stage 2: ", tmp, DEFAULT_BLK_SZ); _get_more_prng_bytes() 170 for (i = DEFAULT_BLK_SZ - 1; i >= 0; i--) { _get_more_prng_bytes() 179 hexdump("Output DT: ", ctx->DT, DEFAULT_BLK_SZ); _get_more_prng_bytes() 180 hexdump("Output I: ", ctx->I, DEFAULT_BLK_SZ); _get_more_prng_bytes() 181 hexdump("Output V: ", ctx->V, DEFAULT_BLK_SZ); _get_more_prng_bytes() 182 hexdump("New Random Data: ", ctx->rand_data, DEFAULT_BLK_SZ); _get_more_prng_bytes() 208 if (nbytes < DEFAULT_BLK_SZ) get_prng_bytes() 210 byte_count = DEFAULT_BLK_SZ; get_prng_bytes() 224 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) { get_prng_bytes() 235 if (byte_count < DEFAULT_BLK_SZ) { get_prng_bytes() 237 while (ctx->rand_data_valid < DEFAULT_BLK_SZ) { get_prng_bytes() 250 for (; byte_count >= DEFAULT_BLK_SZ; byte_count -= DEFAULT_BLK_SZ) { get_prng_bytes() 251 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) { get_prng_bytes() 260 memcpy(ptr, ctx->rand_data, DEFAULT_BLK_SZ); get_prng_bytes() 261 ctx->rand_data_valid += DEFAULT_BLK_SZ; get_prng_bytes() 262 ptr += DEFAULT_BLK_SZ; get_prng_bytes() 299 memcpy(ctx->V, V, DEFAULT_BLK_SZ); reset_prng_context() 301 memcpy(ctx->V, DEFAULT_V_SEED, DEFAULT_BLK_SZ); reset_prng_context() 304 memcpy(ctx->DT, DT, DEFAULT_BLK_SZ); reset_prng_context() 306 memset(ctx->DT, 0, DEFAULT_BLK_SZ); reset_prng_context() 308 memset(ctx->rand_data, 0, DEFAULT_BLK_SZ); reset_prng_context() 309 memset(ctx->last_rand_data, 0, DEFAULT_BLK_SZ); reset_prng_context() 311 ctx->rand_data_valid = DEFAULT_BLK_SZ; reset_prng_context() 373 u8 *key = seed + DEFAULT_BLK_SZ; cprng_reset() 376 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ) cprng_reset() 379 if (slen >= (2 * DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ)) cprng_reset() 400 u8 rdata[DEFAULT_BLK_SZ]; fips_cprng_reset() 401 u8 *key = seed + DEFAULT_BLK_SZ; fips_cprng_reset() 406 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ) fips_cprng_reset() 419 rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, 0); fips_cprng_reset() 420 prng->rand_data_valid = DEFAULT_BLK_SZ; fips_cprng_reset() 441 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ, 459 .seedsize = DEFAULT_PRNG_KSZ + 2*DEFAULT_BLK_SZ,
|
Completed in 71 milliseconds