summaryrefslogtreecommitdiff
path: root/crypto/jitterentropy.h
diff options
context:
space:
mode:
authorJoachim Vandersmissen <git@jvdsn.com>2024-10-09 21:47:34 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2024-10-19 08:44:30 +0800
commit04305f834195c19089ccd965c2911601dd519e87 (patch)
treed1a5d4119015d6d92918e2c27a1ca4191d51daee /crypto/jitterentropy.h
parent9374d6b466577190541ba023ed45e11cf2723c17 (diff)
downloadlinux-04305f834195c19089ccd965c2911601dd519e87.tar.gz
linux-04305f834195c19089ccd965c2911601dd519e87.tar.bz2
linux-04305f834195c19089ccd965c2911601dd519e87.zip
crypto: jitter - output full sample from test interface
The Jitter RNG time delta is computed based on the difference of two high-resolution, 64-bit time stamps. However, the test interface added in 69f1c387ba only outputs the lower 32 bits of those time stamps. To ensure all information is available during the evaluation process of the Jitter RNG, output the full 64-bit time stamps. Any clients collecting data from the test interface will need to be updated to take this change into account. Additionally, the size of the temporary buffer that holds the data for user space has been clarified. Previously, this buffer was JENT_TEST_RINGBUFFER_SIZE (= 1000) bytes in size, however that value represents the number of samples held in the kernel space ring buffer, with each sample taking 8 (previously 4) bytes. Rather than increasing the size to allow for all 1000 samples to be output, we keep it at 1000 bytes, but clarify that this means at most 125 64-bit samples will be output every time this interface is called. Reviewed-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Joachim Vandersmissen <git@jvdsn.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/jitterentropy.h')
-rw-r--r--crypto/jitterentropy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/jitterentropy.h b/crypto/jitterentropy.h
index aa4728675ae2..4c5dbf2a8d8f 100644
--- a/crypto/jitterentropy.h
+++ b/crypto/jitterentropy.h
@@ -22,11 +22,11 @@ extern struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
extern void jent_entropy_collector_free(struct rand_data *entropy_collector);
#ifdef CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE
-int jent_raw_hires_entropy_store(__u32 value);
+int jent_raw_hires_entropy_store(__u64 value);
void jent_testing_init(void);
void jent_testing_exit(void);
#else /* CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE */
-static inline int jent_raw_hires_entropy_store(__u32 value) { return 0; }
+static inline int jent_raw_hires_entropy_store(__u64 value) { return 0; }
static inline void jent_testing_init(void) { }
static inline void jent_testing_exit(void) { }
#endif /* CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE */