Skip to content

Commit 26b265c

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu: - Made x86 ablk_helper generic for ARM - Phase out chainiv in favour of eseqiv (affects IPsec) - Fixed aes-cbc IV corruption on s390 - Added constant-time crypto_memneq which replaces memcmp - Fixed aes-ctr in omap-aes - Added OMAP3 ROM RNG support - Add PRNG support for MSM SoC's - Add and use Job Ring API in caam - Misc fixes [ NOTE! This pull request was sent within the merge window, but Herbert has some questionable email sending setup that makes him public enemy raspberrypi#1 as far as gmail is concerned. So most of his emails seem to be trapped by gmail as spam, resulting in me not seeing them. - Linus ] * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (49 commits) crypto: s390 - Fix aes-cbc IV corruption crypto: omap-aes - Fix CTR mode counter length crypto: omap-sham - Add missing modalias padata: make the sequence counter an atomic_t crypto: caam - Modify the interface layers to use JR API's crypto: caam - Add API's to allocate/free Job Rings crypto: caam - Add Platform driver for Job Ring hwrng: msm - Add PRNG support for MSM SoC's ARM: DT: msm: Add Qualcomm's PRNG driver binding document crypto: skcipher - Use eseqiv even on UP machines crypto: talitos - Simplify key parsing crypto: picoxcell - Simplify and harden key parsing crypto: ixp4xx - Simplify and harden key parsing crypto: authencesn - Simplify key parsing crypto: authenc - Export key parsing helper function crypto: mv_cesa: remove deprecated IRQF_DISABLED hwrng: OMAP3 ROM Random Number Generator support crypto: sha256_ssse3 - also test for BMI2 crypto: mv_cesa - Remove redundant of_match_ptr crypto: sahara - Remove redundant of_match_ptr ...
2 parents 2e7babf + f262f0f commit 26b265c

59 files changed

Lines changed: 1443 additions & 640 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Qualcomm MSM pseudo random number generator.
2+
3+
Required properties:
4+
5+
- compatible : should be "qcom,prng"
6+
- reg : specifies base physical address and size of the registers map
7+
- clocks : phandle to clock-controller plus clock-specifier pair
8+
- clock-names : "core" clocks all registers, FIFO and circuits in PRNG IP block
9+
10+
Example:
11+
12+
rng@f9bff000 {
13+
compatible = "qcom,prng";
14+
reg = <0xf9bff000 0x200>;
15+
clocks = <&clock GCC_PRNG_AHB_CLK>;
16+
clock-names = "core";
17+
};

‎arch/arm/mach-tegra/fuse.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,3 @@ void __init tegra_init_fuse(void)
209209
tegra_sku_id, tegra_cpu_process_id,
210210
tegra_core_process_id);
211211
}
212-
213-
unsigned long long tegra_chip_uid(void)
214-
{
215-
unsigned long long lo, hi;
216-
217-
lo = tegra_fuse_readl(FUSE_UID_LOW);
218-
hi = tegra_fuse_readl(FUSE_UID_HIGH);
219-
return (hi << 32ull) | lo;
220-
}
221-
EXPORT_SYMBOL(tegra_chip_uid);

‎arch/s390/crypto/aes_s390.c‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ static u8 *ctrblk;
3535
static char keylen_flag;
3636

3737
struct s390_aes_ctx {
38-
u8 iv[AES_BLOCK_SIZE];
3938
u8 key[AES_MAX_KEY_SIZE];
4039
long enc;
4140
long dec;
@@ -441,30 +440,36 @@ static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
441440
return aes_set_key(tfm, in_key, key_len);
442441
}
443442

444-
static int cbc_aes_crypt(struct blkcipher_desc *desc, long func, void *param,
443+
static int cbc_aes_crypt(struct blkcipher_desc *desc, long func,
445444
struct blkcipher_walk *walk)
446445
{
446+
struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm);
447447
int ret = blkcipher_walk_virt(desc, walk);
448448
unsigned int nbytes = walk->nbytes;
449+
struct {
450+
u8 iv[AES_BLOCK_SIZE];
451+
u8 key[AES_MAX_KEY_SIZE];
452+
} param;
449453

450454
if (!nbytes)
451455
goto out;
452456

453-
memcpy(param, walk->iv, AES_BLOCK_SIZE);
457+
memcpy(param.iv, walk->iv, AES_BLOCK_SIZE);
458+
memcpy(param.key, sctx->key, sctx->key_len);
454459
do {
455460
/* only use complete blocks */
456461
unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1);
457462
u8 *out = walk->dst.virt.addr;
458463
u8 *in = walk->src.virt.addr;
459464

460-
ret = crypt_s390_kmc(func, param, out, in, n);
465+
ret = crypt_s390_kmc(func, &param, out, in, n);
461466
if (ret < 0 || ret != n)
462467
return -EIO;
463468

464469
nbytes &= AES_BLOCK_SIZE - 1;
465470
ret = blkcipher_walk_done(desc, walk, nbytes);
466471
} while ((nbytes = walk->nbytes));
467-
memcpy(walk->iv, param, AES_BLOCK_SIZE);
472+
memcpy(walk->iv, param.iv, AES_BLOCK_SIZE);
468473

469474
out:
470475
return ret;
@@ -481,7 +486,7 @@ static int cbc_aes_encrypt(struct blkcipher_desc *desc,
481486
return fallback_blk_enc(desc, dst, src, nbytes);
482487

483488
blkcipher_walk_init(&walk, dst, src, nbytes);
484-
return cbc_aes_crypt(desc, sctx->enc, sctx->iv, &walk);
489+
return cbc_aes_crypt(desc, sctx->enc, &walk);
485490
}
486491

487492
static int cbc_aes_decrypt(struct blkcipher_desc *desc,
@@ -495,7 +500,7 @@ static int cbc_aes_decrypt(struct blkcipher_desc *desc,
495500
return fallback_blk_dec(desc, dst, src, nbytes);
496501

497502
blkcipher_walk_init(&walk, dst, src, nbytes);
498-
return cbc_aes_crypt(desc, sctx->dec, sctx->iv, &walk);
503+
return cbc_aes_crypt(desc, sctx->dec, &walk);
499504
}
500505

501506
static struct crypto_alg cbc_aes_alg = {

‎arch/x86/crypto/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
#
44

55
avx_supported := $(call as-instr,vpxor %xmm0$(comma)%xmm0$(comma)%xmm0,yes,no)
6+
avx2_supported := $(call as-instr,vpgatherdd %ymm0$(comma)(%eax$(comma)%ymm1\
7+
$(comma)4)$(comma)%ymm2,yes,no)
68

7-
obj-$(CONFIG_CRYPTO_ABLK_HELPER_X86) += ablk_helper.o
89
obj-$(CONFIG_CRYPTO_GLUE_HELPER_X86) += glue_helper.o
910

1011
obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o

‎arch/x86/crypto/aesni-intel_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <asm/cpu_device_id.h>
3535
#include <asm/i387.h>
3636
#include <asm/crypto/aes.h>
37-
#include <asm/crypto/ablk_helper.h>
37+
#include <crypto/ablk_helper.h>
3838
#include <crypto/scatterwalk.h>
3939
#include <crypto/internal/aead.h>
4040
#include <linux/workqueue.h>

‎arch/x86/crypto/camellia_aesni_avx2_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
#include <linux/types.h>
1515
#include <linux/crypto.h>
1616
#include <linux/err.h>
17+
#include <crypto/ablk_helper.h>
1718
#include <crypto/algapi.h>
1819
#include <crypto/ctr.h>
1920
#include <crypto/lrw.h>
2021
#include <crypto/xts.h>
2122
#include <asm/xcr.h>
2223
#include <asm/xsave.h>
2324
#include <asm/crypto/camellia.h>
24-
#include <asm/crypto/ablk_helper.h>
2525
#include <asm/crypto/glue_helper.h>
2626

2727
#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16

‎arch/x86/crypto/camellia_aesni_avx_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
#include <linux/types.h>
1515
#include <linux/crypto.h>
1616
#include <linux/err.h>
17+
#include <crypto/ablk_helper.h>
1718
#include <crypto/algapi.h>
1819
#include <crypto/ctr.h>
1920
#include <crypto/lrw.h>
2021
#include <crypto/xts.h>
2122
#include <asm/xcr.h>
2223
#include <asm/xsave.h>
2324
#include <asm/crypto/camellia.h>
24-
#include <asm/crypto/ablk_helper.h>
2525
#include <asm/crypto/glue_helper.h>
2626

2727
#define CAMELLIA_AESNI_PARALLEL_BLOCKS 16

‎arch/x86/crypto/cast5_avx_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
#include <linux/types.h>
2727
#include <linux/crypto.h>
2828
#include <linux/err.h>
29+
#include <crypto/ablk_helper.h>
2930
#include <crypto/algapi.h>
3031
#include <crypto/cast5.h>
3132
#include <crypto/cryptd.h>
3233
#include <crypto/ctr.h>
3334
#include <asm/xcr.h>
3435
#include <asm/xsave.h>
35-
#include <asm/crypto/ablk_helper.h>
3636
#include <asm/crypto/glue_helper.h>
3737

3838
#define CAST5_PARALLEL_BLOCKS 16

‎arch/x86/crypto/cast6_avx_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/types.h>
2929
#include <linux/crypto.h>
3030
#include <linux/err.h>
31+
#include <crypto/ablk_helper.h>
3132
#include <crypto/algapi.h>
3233
#include <crypto/cast6.h>
3334
#include <crypto/cryptd.h>
@@ -37,7 +38,6 @@
3738
#include <crypto/xts.h>
3839
#include <asm/xcr.h>
3940
#include <asm/xsave.h>
40-
#include <asm/crypto/ablk_helper.h>
4141
#include <asm/crypto/glue_helper.h>
4242

4343
#define CAST6_PARALLEL_BLOCKS 8

‎arch/x86/crypto/serpent_avx2_glue.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/types.h>
1515
#include <linux/crypto.h>
1616
#include <linux/err.h>
17+
#include <crypto/ablk_helper.h>
1718
#include <crypto/algapi.h>
1819
#include <crypto/ctr.h>
1920
#include <crypto/lrw.h>
@@ -22,7 +23,6 @@
2223
#include <asm/xcr.h>
2324
#include <asm/xsave.h>
2425
#include <asm/crypto/serpent-avx.h>
25-
#include <asm/crypto/ablk_helper.h>
2626
#include <asm/crypto/glue_helper.h>
2727

2828
#define SERPENT_AVX2_PARALLEL_BLOCKS 16

0 commit comments

Comments
 (0)