Skip to content

Commit 9048bec

Browse files
jaingaurav2712herbertx
authored andcommitted
crypto: caam - double the entropy delay interval for retry
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. the entropy delay interval should be doubled before performing the retry. also, ctrlpriv->rng4_sh_init and inst_handles both reads RNG DRNG status register, but only inst_handles is updated before every retry. so only check inst_handles and removing ctrlpriv->rng4_sh_init Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 4fcd322 commit 9048bec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/crypto/caam/ctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,12 +703,12 @@ static int caam_ctrl_rng_init(struct device *dev)
703703
*/
704704
if (needs_entropy_delay_adjustment())
705705
ent_delay = 12000;
706-
if (!(ctrlpriv->rng4_sh_init || inst_handles)) {
706+
if (!inst_handles) {
707707
dev_info(dev,
708708
"Entropy delay = %u\n",
709709
ent_delay);
710710
kick_trng(dev, ent_delay);
711-
ent_delay += 400;
711+
ent_delay = ent_delay * 2;
712712
}
713713
/*
714714
* if instantiate_rng(...) fails, the loop will rerun

0 commit comments

Comments
 (0)