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: (102 commits) crypto: sha-s390 - Fix warnings in import function crypto: vmac - New hash algorithm for intel_txt support crypto: api - Do not displace newly registered algorithms crypto: ansi_cprng - Fix module initialization crypto: xcbc - Fix alignment calculation of xcbc_tfm_ctx crypto: fips - Depend on ansi_cprng crypto: blkcipher - Do not use eseqiv on stream ciphers crypto: ctr - Use chainiv on raw counter mode Revert crypto: fips - Select CPRNG crypto: rng - Fix typo crypto: talitos - add support for 36 bit addressing crypto: talitos - align locks on cache lines crypto: talitos - simplify hmac data size calculation crypto: mv_cesa - Add support for Orion5X crypto engine crypto: cryptd - Add support to access underlaying shash crypto: gcm - Use GHASH digest algorithm crypto: ghash - Add GHASH digest algorithm for GCM crypto: authenc - Convert to ahash crypto: api - Fix aligned ctx helper crypto: hmac - Prehash ipad/opad ...
This commit is contained in:
@@ -44,8 +44,8 @@
|
||||
* want to register another driver on the same PCI id.
|
||||
*/
|
||||
static const struct pci_device_id pci_tbl[] = {
|
||||
{ 0x1022, 0x7443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
|
||||
{ 0x1022, 0x746b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
|
||||
{ PCI_VDEVICE(AMD, 0x7443), 0, },
|
||||
{ PCI_VDEVICE(AMD, 0x746b), 0, },
|
||||
{ 0, }, /* terminate list */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, pci_tbl);
|
||||
|
@@ -46,8 +46,7 @@
|
||||
* want to register another driver on the same PCI id.
|
||||
*/
|
||||
static const struct pci_device_id pci_tbl[] = {
|
||||
{ PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_LX_AES,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
|
||||
{ PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_LX_AES), 0, },
|
||||
{ 0, }, /* terminate list */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, pci_tbl);
|
||||
|
@@ -240,6 +240,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/cryptohash.h>
|
||||
#include <linux/fips.h>
|
||||
|
||||
#ifdef CONFIG_GENERIC_HARDIRQS
|
||||
# include <linux/irq.h>
|
||||
@@ -413,6 +414,7 @@ struct entropy_store {
|
||||
unsigned add_ptr;
|
||||
int entropy_count;
|
||||
int input_rotate;
|
||||
__u8 *last_data;
|
||||
};
|
||||
|
||||
static __u32 input_pool_data[INPUT_POOL_WORDS];
|
||||
@@ -852,12 +854,21 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
|
||||
{
|
||||
ssize_t ret = 0, i;
|
||||
__u8 tmp[EXTRACT_SIZE];
|
||||
unsigned long flags;
|
||||
|
||||
xfer_secondary_pool(r, nbytes);
|
||||
nbytes = account(r, nbytes, min, reserved);
|
||||
|
||||
while (nbytes) {
|
||||
extract_buf(r, tmp);
|
||||
|
||||
if (r->last_data) {
|
||||
spin_lock_irqsave(&r->lock, flags);
|
||||
if (!memcmp(tmp, r->last_data, EXTRACT_SIZE))
|
||||
panic("Hardware RNG duplicated output!\n");
|
||||
memcpy(r->last_data, tmp, EXTRACT_SIZE);
|
||||
spin_unlock_irqrestore(&r->lock, flags);
|
||||
}
|
||||
i = min_t(int, nbytes, EXTRACT_SIZE);
|
||||
memcpy(buf, tmp, i);
|
||||
nbytes -= i;
|
||||
@@ -940,6 +951,9 @@ 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