summaryrefslogtreecommitdiff
path: root/crypto/jitterentropy-kcapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/jitterentropy-kcapi.c')
-rw-r--r--crypto/jitterentropy-kcapi.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c
index 1266eb790708..7c880cf34c52 100644
--- a/crypto/jitterentropy-kcapi.c
+++ b/crypto/jitterentropy-kcapi.c
@@ -48,7 +48,7 @@
#include "jitterentropy.h"
-#define JENT_CONDITIONING_HASH "sha3-256-generic"
+#define JENT_CONDITIONING_HASH "sha3-256"
/***************************************************************************
* Helper function
@@ -117,6 +117,7 @@ int jent_hash_time(void *hash_state, __u64 time, u8 *addtl,
pr_warn_ratelimited("Unexpected digest size\n");
return -EINVAL;
}
+ kmsan_unpoison_memory(intermediary, sizeof(intermediary));
/*
* This loop fills a buffer which is injected into the entropy pool.
@@ -229,15 +230,7 @@ static int jent_kcapi_init(struct crypto_tfm *tfm)
spin_lock_init(&rng->jent_lock);
- /*
- * Use SHA3-256 as conditioner. We allocate only the generic
- * implementation as we are not interested in high-performance. The
- * execution time of the SHA3 operation is measured and adds to the
- * Jitter RNG's unpredictable behavior. If we have a slower hash
- * implementation, the execution timing variations are larger. When
- * using a fast implementation, we would need to call it more often
- * as its variations are lower.
- */
+ /* Use SHA3-256 as conditioner */
hash = crypto_alloc_shash(JENT_CONDITIONING_HASH, 0, 0);
if (IS_ERR(hash)) {
pr_err("Cannot allocate conditioning digest\n");