Lines Matching refs:DEFAULT_BLK_SZ
20 #define DEFAULT_BLK_SZ 16
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];
78 * Returns DEFAULT_BLK_SZ bytes of random data per call
84 unsigned char tmp[DEFAULT_BLK_SZ];
91 hexdump("Input DT: ", ctx->DT, DEFAULT_BLK_SZ);
92 hexdump("Input I: ", ctx->I, DEFAULT_BLK_SZ);
93 hexdump("Input V: ", ctx->V, DEFAULT_BLK_SZ);
106 memcpy(tmp, ctx->DT, DEFAULT_BLK_SZ);
108 hexdump("tmp stage 0: ", tmp, DEFAULT_BLK_SZ);
117 xor_vectors(ctx->I, ctx->V, tmp, DEFAULT_BLK_SZ);
118 hexdump("tmp stage 1: ", tmp, DEFAULT_BLK_SZ);
127 DEFAULT_BLK_SZ)) {
141 DEFAULT_BLK_SZ);
148 DEFAULT_BLK_SZ);
150 hexdump("tmp stage 2: ", tmp, DEFAULT_BLK_SZ);
163 for (i = DEFAULT_BLK_SZ - 1; i >= 0; i--) {
172 hexdump("Output DT: ", ctx->DT, DEFAULT_BLK_SZ);
173 hexdump("Output I: ", ctx->I, DEFAULT_BLK_SZ);
174 hexdump("Output V: ", ctx->V, DEFAULT_BLK_SZ);
175 hexdump("New Random Data: ", ctx->rand_data, DEFAULT_BLK_SZ);
201 if (nbytes < DEFAULT_BLK_SZ)
203 byte_count = DEFAULT_BLK_SZ;
217 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) {
228 if (byte_count < DEFAULT_BLK_SZ) {
230 while (ctx->rand_data_valid < DEFAULT_BLK_SZ) {
243 for (; byte_count >= DEFAULT_BLK_SZ; byte_count -= DEFAULT_BLK_SZ) {
244 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) {
253 memcpy(ptr, ctx->rand_data, DEFAULT_BLK_SZ);
254 ctx->rand_data_valid += DEFAULT_BLK_SZ;
255 ptr += DEFAULT_BLK_SZ;
292 memcpy(ctx->V, V, DEFAULT_BLK_SZ);
294 memcpy(ctx->V, DEFAULT_V_SEED, DEFAULT_BLK_SZ);
297 memcpy(ctx->DT, DT, DEFAULT_BLK_SZ);
299 memset(ctx->DT, 0, DEFAULT_BLK_SZ);
301 memset(ctx->rand_data, 0, DEFAULT_BLK_SZ);
302 memset(ctx->last_rand_data, 0, DEFAULT_BLK_SZ);
304 ctx->rand_data_valid = DEFAULT_BLK_SZ;
368 const u8 *key = seed + DEFAULT_BLK_SZ;
371 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ)
374 if (slen >= (2 * DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ))
397 u8 rdata[DEFAULT_BLK_SZ];
398 const u8 *key = seed + DEFAULT_BLK_SZ;
403 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ)
416 rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, 0);
417 prng->rand_data_valid = DEFAULT_BLK_SZ;
427 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,
441 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,