]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
crypto/rng: double the entropy delay interval for retry
authorGaurav Jain <gaurav.jain@nxp.com>
Fri, 5 Sep 2025 09:33:48 +0000 (15:03 +0530)
committerPeng Fan <peng.fan@nxp.com>
Fri, 10 Oct 2025 03:44:27 +0000 (11:44 +0800)
During entropy evaluation, if the generated samples fail any statistical test,
then, all of the bits will be discarded, and a second set of samples will be
generated and tested.

Double the ent_delay to give more chance to pass before performing retry.

Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/crypto/fsl/jr.c

index 8f7a821ebf3d933c26f83bf86b4d75a264c94208..07d336c074af01c9bb0dd268cd7b28ac7b6d0cad 100644 (file)
@@ -642,7 +642,7 @@ static int rng_init(uint8_t sec_idx, ccsr_sec_t *sec)
                 */
                if (!inst_handles) {
                        kick_trng(ent_delay, sec);
-                       ent_delay += 400;
+                       ent_delay = ent_delay * 2;
                }
                /*
                 * if instantiate_rng(...) fails, the loop will rerun