Lines Matching defs:entropy

15  * Note that the TRNG Firmware interface can request up to 192 bits of entropy
18 * 192 bits of entropy, we don't have to throw out the leftover 1-63 bits of
19 * entropy.
22 static uint64_t entropy[WORDS_IN_POOL];
23 /* index in bits of the first bit of usable entropy */
25 /* then number of valid bits in the entropy pool */
30 #define BITS_PER_WORD (sizeof(entropy[0]) * 8)
40 * Fill the entropy pool until we have at least as many bits as requested.
41 * Returns true after filling the pool, and false if the entropy source is out
42 * of entropy and the pool could not be filled.
48 bool valid = plat_get_entropy(&entropy[ENTROPY_FREE_INDEX]);
61 * Pack entropy into the out buffer, filling and taking locks as needed.
64 * Note: out must have enough space for nbits of entropy
84 * Repack the entropy from the pool into the passed in out
89 * valid entropy, ` ` represents invalid bits (not entropy) and
90 * `x` represents valid entropy that must not end up in the
93 * |---------entropy pool----------|
103 * |---------entropy pool----------|
114 out[word_i] |= entropy[ENTROPY_WORD_INDEX(word_i)] >> rshift;
117 * Discarding the used/packed entropy bits from the respective
119 * In each iteration of the loop, we pack 64bits of entropy to
121 * 1st word (entropy[0]) till 4th word (entropy[3]) and then
122 * rolls back (entropy[0]). Discarding of bits is managed
127 * |---------entropy pool----------|
159 entropy[ENTROPY_WORD_INDEX(word_i)] &=
170 entropy[ENTROPY_WORD_INDEX(word_i)] = 0;
177 * don't want to include the next word of entropy, so we skip
181 out[word_i] |= entropy[ENTROPY_WORD_INDEX(word_i + 1)]
194 entropy[ENTROPY_WORD_INDEX(word_i+1)] &=
204 * there are still some unused valid entropy bits at the
207 entropy[ENTROPY_WORD_INDEX(word_i+1)] &=
232 entropy[i] = 0;