Verwenden von RNDADDENTROPY, um / dev / random Entropie hinzuzufügen

Ich habe ein Gerät, das Rauschen erzeugt, das ich dem Entropiepool für das Gerät / dev / random in einem eingebetteten Linux-System hinzufügen möchte.

Ich lese dieManpage auf / dev / random und ich verstehe die Struktur, die Sie in den Aufruf RNDADDENTROPY ioctl übergeben, nicht wirklich.

   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.

Istentropy_count in dieser Struktur die Anzahl der Bits, die ich addiere? Warum sollte das nicht immer so sein?buf_size * 8 (vorausgesetzt, dassbuf_size ist in Bytes ausgedrückt)?

Außerdem, warum istbuf ein Array mit der Größe Null? Wie soll ich ihm einen Wert zuweisen?

Vielen Dank für jede Hilfe hier!

Antworten auf die Frage(3)

Ihre Antwort auf die Frage