Lines Matching refs:DEFAULT_BLK_SZ
19 #define DEFAULT_BLK_SZ 16
40 unsigned char rand_data[DEFAULT_BLK_SZ];
41 unsigned char last_rand_data[DEFAULT_BLK_SZ];
42 unsigned char DT[DEFAULT_BLK_SZ];
43 unsigned char I[DEFAULT_BLK_SZ];
44 unsigned char V[DEFAULT_BLK_SZ];
77 * Returns DEFAULT_BLK_SZ bytes of random data per call
83 unsigned char tmp[DEFAULT_BLK_SZ];
90 hexdump("Input DT: ", ctx->DT, DEFAULT_BLK_SZ);
91 hexdump("Input I: ", ctx->I, DEFAULT_BLK_SZ);
92 hexdump("Input V: ", ctx->V, DEFAULT_BLK_SZ);
105 memcpy(tmp, ctx->DT, DEFAULT_BLK_SZ);
107 hexdump("tmp stage 0: ", tmp, DEFAULT_BLK_SZ);
116 xor_vectors(ctx->I, ctx->V, tmp, DEFAULT_BLK_SZ);
117 hexdump("tmp stage 1: ", tmp, DEFAULT_BLK_SZ);
126 DEFAULT_BLK_SZ)) {
140 DEFAULT_BLK_SZ);
147 DEFAULT_BLK_SZ);
149 hexdump("tmp stage 2: ", tmp, DEFAULT_BLK_SZ);
162 for (i = DEFAULT_BLK_SZ - 1; i >= 0; i--) {
171 hexdump("Output DT: ", ctx->DT, DEFAULT_BLK_SZ);
172 hexdump("Output I: ", ctx->I, DEFAULT_BLK_SZ);
173 hexdump("Output V: ", ctx->V, DEFAULT_BLK_SZ);
174 hexdump("New Random Data: ", ctx->rand_data, DEFAULT_BLK_SZ);
200 if (nbytes < DEFAULT_BLK_SZ)
202 byte_count = DEFAULT_BLK_SZ;
216 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) {
227 if (byte_count < DEFAULT_BLK_SZ) {
229 while (ctx->rand_data_valid < DEFAULT_BLK_SZ) {
242 for (; byte_count >= DEFAULT_BLK_SZ; byte_count -= DEFAULT_BLK_SZ) {
243 if (ctx->rand_data_valid == DEFAULT_BLK_SZ) {
252 memcpy(ptr, ctx->rand_data, DEFAULT_BLK_SZ);
253 ctx->rand_data_valid += DEFAULT_BLK_SZ;
254 ptr += DEFAULT_BLK_SZ;
291 memcpy(ctx->V, V, DEFAULT_BLK_SZ);
293 memcpy(ctx->V, DEFAULT_V_SEED, DEFAULT_BLK_SZ);
296 memcpy(ctx->DT, DT, DEFAULT_BLK_SZ);
298 memset(ctx->DT, 0, DEFAULT_BLK_SZ);
300 memset(ctx->rand_data, 0, DEFAULT_BLK_SZ);
301 memset(ctx->last_rand_data, 0, DEFAULT_BLK_SZ);
303 ctx->rand_data_valid = DEFAULT_BLK_SZ;
367 const u8 *key = seed + DEFAULT_BLK_SZ;
370 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ)
373 if (slen >= (2 * DEFAULT_BLK_SZ + DEFAULT_PRNG_KSZ))
396 u8 rdata[DEFAULT_BLK_SZ];
397 const u8 *key = seed + DEFAULT_BLK_SZ;
402 if (slen < DEFAULT_PRNG_KSZ + DEFAULT_BLK_SZ)
415 rc = get_prng_bytes(rdata, DEFAULT_BLK_SZ, prng, 0);
416 prng->rand_data_valid = DEFAULT_BLK_SZ;
426 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,
440 .seedsize = DEFAULT_PRNG_KSZ + 2 * DEFAULT_BLK_SZ,