Usando RNDADDENTROPY para agregar entropía a / dev / random
Tengo un dispositivo que genera un poco de ruido que quiero agregar al grupo de entropía para el dispositivo / dev / random en un sistema Linux incorporado.
Estoy leyendo elpágina de manual en / dev / random y realmente no entiendo la estructura que usted pasa a la llamada ioctl RNDADDENTROPY.
RNDADDENTROPY
Add some additional entropy to the input pool, incrementing
the entropy count. This differs from writing to /dev/random
or /dev/urandom, which only adds some data but does not
increment the entropy count. The following structure is used:
struct rand_pool_info {
int entropy_count;
int buf_size;
__u32 buf[0];
};
Here entropy_count is the value added to (or subtracted from)
the entropy count, and buf is the buffer of size buf_size
which gets added to the entropy pool.
Esentropy_count
en esta estructura el numero de bits que estoy agregando? ¿Por qué no sería esto siempre siemprebuf_size * 8
(asumiendo quebuf_size
es en términos de bytes)?
Además, ¿por qué esbuf
una matriz de tamaño cero? ¿Cómo se supone que debo asignarle un valor?
Gracias por cualquier ayuda aquí!