Entropy estimation by Linux Kernel when adding entropy from TRNG As per resources given below, after adding the bits to entropy pool, the Linux RNG estimates the amount of entropy for "credit_entropy_bits" function. It is estimating the amount of entropy of an event as a function of its timing. Initially, the estimator calculates the jiffies differences on three levels. Then, estimator takes the minimum of the differences absolute values and finally, it assigns it a value between 0 and 11.  

I am using a TRNG for supplying entropy to Linux entropy pool. The output of TRNG is 160 bits i.e. the entropy of source is 160 bits. In case of TRNG, What will be value of entropy for "credit_entropy_bits" function ? Will it be 160 bits ?

I have pointed the "rng_current" to "rng-caam". I am running "rngd" with r option i.e. "rngd -r /dev/hwrng".


https://hal.inria.fr/hal-00738638/file/rr8060.pdf
https://eprint.iacr.org/2012/487.pdf
https://github.com/torvalds/linux/blob/master/drivers/char/random.c
When you are adding entropy from outside the kernel, the kernel's entropy estimation functions are not used. Instead the entropy count is either not updated (e.g. if you just write data to /dev/random) or is updated according to the entropy count given to the kernel (e.g. through the RNDADDENTROPY ioctl).

Since you are using rngd, it will run some tests and assuming they pass ask the kernel to credit the entropy count with the full size of the data that was mixed in. I.e. 160 bits if you had 160 bits of data from the TRNG.