Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (46 commits) random: simplify fips mode crypto: authenc - Fix cryptlen calculation crypto: talitos - add support for sha224 crypto: talitos - add hash algorithms crypto: talitos - second prepare step for adding ahash algorithms crypto: talitos - prepare for adding ahash algorithms crypto: n2 - Add Niagara2 crypto driver crypto: skcipher - Add ablkcipher_walk interfaces crypto: testmgr - Add testing for async hashing and update/final crypto: tcrypt - Add speed tests for async hashing crypto: scatterwalk - Fix scatterwalk_done() test crypto: hifn_795x - Rename ablkcipher_walk to hifn_cipher_walk padata: Use get_online_cpus/put_online_cpus in padata_free padata: Add some code comments padata: Flush the padata queues actively padata: Use a timer to handle remaining objects in the reorder queues crypto: shash - Remove usage of CRYPTO_MINALIGN crypto: mv_cesa - Use resource_size crypto: omap - OMAP macros corrected padata: Use get_online_cpus/put_online_cpus ... Fix up conflicts in arch/arm/mach-omap2/devices.c
This commit is contained in:
@@ -257,6 +257,7 @@
|
||||
#define INPUT_POOL_WORDS 128
|
||||
#define OUTPUT_POOL_WORDS 32
|
||||
#define SEC_XFER_SIZE 512
|
||||
#define EXTRACT_SIZE 10
|
||||
|
||||
/*
|
||||
* The minimum number of bits of entropy before we wake up a read on
|
||||
@@ -414,7 +415,7 @@ struct entropy_store {
|
||||
unsigned add_ptr;
|
||||
int entropy_count;
|
||||
int input_rotate;
|
||||
__u8 *last_data;
|
||||
__u8 last_data[EXTRACT_SIZE];
|
||||
};
|
||||
|
||||
static __u32 input_pool_data[INPUT_POOL_WORDS];
|
||||
@@ -714,8 +715,6 @@ void add_disk_randomness(struct gendisk *disk)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define EXTRACT_SIZE 10
|
||||
|
||||
/*********************************************************************
|
||||
*
|
||||
* Entropy extraction routines
|
||||
@@ -862,7 +861,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
|
||||
while (nbytes) {
|
||||
extract_buf(r, tmp);
|
||||
|
||||
if (r->last_data) {
|
||||
if (fips_enabled) {
|
||||
spin_lock_irqsave(&r->lock, flags);
|
||||
if (!memcmp(tmp, r->last_data, EXTRACT_SIZE))
|
||||
panic("Hardware RNG duplicated output!\n");
|
||||
@@ -951,9 +950,6 @@ static void init_std_data(struct entropy_store *r)
|
||||
now = ktime_get_real();
|
||||
mix_pool_bytes(r, &now, sizeof(now));
|
||||
mix_pool_bytes(r, utsname(), sizeof(*(utsname())));
|
||||
/* Enable continuous test in fips mode */
|
||||
if (fips_enabled)
|
||||
r->last_data = kmalloc(EXTRACT_SIZE, GFP_KERNEL);
|
||||
}
|
||||
|
||||
static int rand_initialize(void)
|
||||
|
||||
Reference in New Issue
Block a user