diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-23 19:18:25 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-23 19:18:25 -0500 |
| commit | 26b265cd29dde56bf0901c421eabc7ae815f38c4 (patch) | |
| tree | 83a5418c96ccde8522bda6614063b665fe5e0ec9 | |
| parent | 2e7babfa892a55588467ef03b545002e32f31528 (diff) | |
| parent | f262f0f5cad0c9eca61d1d383e3b67b57dcbe5ea (diff) | |
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
#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
...
59 files changed, 1443 insertions, 640 deletions
diff --git a/Documentation/devicetree/bindings/rng/qcom,prng.txt b/Documentation/devicetree/bindings/rng/qcom,prng.txt new file mode 100644 index 000000000000..8e5853c2879b --- /dev/null +++ b/Documentation/devicetree/bindings/rng/qcom,prng.txt | |||
| @@ -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 | }; | ||
diff --git a/arch/arm/mach-tegra/fuse.c b/arch/arm/mach-tegra/fuse.c index d4639c506622..9a4e910c3796 100644 --- a/arch/arm/mach-tegra/fuse.c +++ b/arch/arm/mach-tegra/fuse.c | |||
| @@ -209,13 +209,3 @@ void __init tegra_init_fuse(void) | |||
| 209 | tegra_sku_id, tegra_cpu_process_id, | 209 | tegra_sku_id, tegra_cpu_process_id, |
| 210 | tegra_core_process_id); | 210 | tegra_core_process_id); |
| 211 | } | 211 | } |
| 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); | ||
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 46cae138ece2..4363528dc8fd 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
| @@ -35,7 +35,6 @@ static u8 *ctrblk; | |||
| 35 | static char keylen_flag; | 35 | static char keylen_flag; |
| 36 | 36 | ||
| 37 | struct s390_aes_ctx { | 37 | struct s390_aes_ctx { |
| 38 | u8 iv[AES_BLOCK_SIZE]; | ||
| 39 | u8 key[AES_MAX_KEY_SIZE]; | 38 | u8 key[AES_MAX_KEY_SIZE]; |
| 40 | long enc; | 39 | long enc; |
| 41 | long dec; | 40 | long dec; |
| @@ -441,30 +440,36 @@ static int cbc_aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, | |||
| 441 | return aes_set_key(tfm, in_key, key_len); | 440 | return aes_set_key(tfm, in_key, key_len); |
| 442 | } | 441 | } |
| 443 | 442 | ||
| 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, |
| 445 | struct blkcipher_walk *walk) | 444 | struct blkcipher_walk *walk) |
| 446 | { | 445 | { |
| 446 | struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); | ||
| 447 | int ret = blkcipher_walk_virt(desc, walk); | 447 | int ret = blkcipher_walk_virt(desc, walk); |
| 448 | unsigned int nbytes = walk->nbytes; | 448 | unsigned int nbytes = walk->nbytes; |
| 449 | struct { | ||
| 450 | u8 iv[AES_BLOCK_SIZE]; | ||
| 451 | u8 key[AES_MAX_KEY_SIZE]; | ||
| 452 | } param; | ||
| 449 | 453 | ||
| 450 | if (!nbytes) | 454 | if (!nbytes) |
| 451 | goto out; | 455 | goto out; |
| 452 | 456 | ||
| 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); | ||
| 454 | do { | 459 | do { |
| 455 | /* only use complete blocks */ | 460 | /* only use complete blocks */ |
| 456 | unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1); | 461 | unsigned int n = nbytes & ~(AES_BLOCK_SIZE - 1); |
| 457 | u8 *out = walk->dst.virt.addr; | 462 | u8 *out = walk->dst.virt.addr; |
| 458 | u8 *in = walk->src.virt.addr; | 463 | u8 *in = walk->src.virt.addr; |
| 459 | 464 | ||
| 460 | ret = crypt_s390_kmc(func, param, out, in, n); | 465 | ret = crypt_s390_kmc(func, ¶m, out, in, n); |
| 461 | if (ret < 0 || ret != n) | 466 | if (ret < 0 || ret != n) |
| 462 | return -EIO; | 467 | return -EIO; |
| 463 | 468 | ||
| 464 | |||
