Skip to contentSkip to conversation

crypto: jitterentropy - drop redundant delta check in jent_entropy_init

PATCH In review Thorsten Blum 3 participants 5 messages May 4 – May 15 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 crypto: jitterentropy - drop redundant delta check in jent_entropy_init

Since start_time = end_time - delta, start_time can only equal end_time when delta is 0, making the explicit end_time == start_time check redundant. Remove it.

---
 crypto/jitterentropy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/jitterentropy.c +1 -1
index d5832caa8ab3..6ac0257e8e0a 100644
@@ -775,7 +775,7 @@ int jent_entropy_init(unsigned int osr, unsigned int flags,
 		 * delta even when called shortly after each other -- this
 		 * implies that we also have a high resolution timer
 		 */
-		if (!delta || (end_time == start_time)) {
+		if (!delta) {
 			ret = JENT_ECOARSETIME;
 			goto out;
 		}
#1 lore raw

PATCH 2/2 crypto: jitterentropy - fix URL

The URL https://www.chronox.de/jent.html resolves to a 404 Not Found. Use https://www.chronox.de/jent/ instead.

---
 crypto/jitterentropy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/jitterentropy.c +2 -2
index 6ac0257e8e0a..b024bff7024a 100644
@@ -7,7 +7,7 @@
  * Design
  * ======
  *
- * See https://www.chronox.de/jent.html
+ * See https://www.chronox.de/jent/
  *
  * License
  * =======
@@ -47,7 +47,7 @@
 
 /*
  * This Jitterentropy RNG is based on the jitterentropy library
- * version 3.4.0 provided at https://www.chronox.de/jent.html
+ * version 3.4.0 provided at https://www.chronox.de/jent/
  */
 
 #ifdef __OPTIMIZE__
maintainer
#4 lore raw
In reply to Thorsten Blum
Quoted 8 lines · Thorsten Blum

Since start_time = end_time - delta, start_time can only equal end_time when delta is 0, making the explicit end_time == start_time check redundant. Remove it.

---
 crypto/jitterentropy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

All applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt