ublk: simplify aborting request
[linux-block.git] / crypto / jitterentropy.h
CommitLineData
965d7286
BD
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3extern void *jent_zalloc(unsigned int len);
4extern void jent_zfree(void *ptr);
965d7286 5extern void jent_get_nstime(__u64 *out);
bb897c55
SM
6extern int jent_hash_time(void *hash_state, __u64 time, u8 *addtl,
7 unsigned int addtl_len, __u64 hash_loop_cnt,
8 unsigned int stuck);
9int jent_read_random_block(void *hash_state, char *dst, unsigned int dst_len);
965d7286
BD
10
11struct rand_data;
bb897c55 12extern int jent_entropy_init(void *hash_state);
965d7286
BD
13extern int jent_read_entropy(struct rand_data *ec, unsigned char *data,
14 unsigned int len);
15
16extern struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
bb897c55
SM
17 unsigned int flags,
18 void *hash_state);
965d7286 19extern void jent_entropy_collector_free(struct rand_data *entropy_collector);
69f1c387
SM
20
21#ifdef CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE
22int jent_raw_hires_entropy_store(__u32 value);
23void jent_testing_init(void);
24void jent_testing_exit(void);
25#else /* CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE */
26static inline int jent_raw_hires_entropy_store(__u32 value) { return 0; }
27static inline void jent_testing_init(void) { }
28static inline void jent_testing_exit(void) { }
29#endif /* CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE */