Skip to content

Commit 81ff5d2

Browse files
committed
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu: "API: - Add support for AEAD in simd - Add fuzz testing to testmgr - Add panic_on_fail module parameter to testmgr - Use per-CPU struct instead multiple variables in scompress - Change verify API for akcipher Algorithms: - Convert x86 AEAD algorithms over to simd - Forbid 2-key 3DES in FIPS mode - Add EC-RDSA (GOST 34.10) algorithm Drivers: - Set output IV with ctr-aes in crypto4xx - Set output IV in rockchip - Fix potential length overflow with hashing in sun4i-ss - Fix computation error with ctr in vmx - Add SM4 protected keys support in ccree - Remove long-broken mxc-scc driver - Add rfc4106(gcm(aes)) cipher support in cavium/nitrox" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (179 commits) crypto: ccree - use a proper le32 type for le32 val crypto: ccree - remove set but not used variable 'du_size' crypto: ccree - Make cc_sec_disable static crypto: ccree - fix spelling mistake "protedcted" -> "protected" crypto: caam/qi2 - generate hash keys in-place crypto: caam/qi2 - fix DMA mapping of stack memory crypto: caam/qi2 - fix zero-length buffer DMA mapping crypto: stm32/cryp - update to return iv_out crypto: stm32/cryp - remove request mutex protection crypto: stm32/cryp - add weak key check for DES crypto: atmel - remove set but not used variable 'alg_name' crypto: picoxcell - Use dev_get_drvdata() crypto: crypto4xx - get rid of redundant using_sd variable crypto: crypto4xx - use sync skcipher for fallback crypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues crypto: crypto4xx - fix ctr-aes missing output IV crypto: ecrdsa - select ASN1 and OID_REGISTRY for EC-RDSA crypto: ux500 - use ccflags-y instead of CFLAGS_<basename>.o crypto: ccree - handle tee fips error during power management resume crypto: ccree - add function to handle cryptocell tee fips error ...
2 parents 7aefd94 + e59f755 commit 81ff5d2

File tree

322 files changed

+5973
-4248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+5973
-4248
lines changed

Documentation/crypto/api-samples.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Code Example For Use of Operational State Memory With SHASH
133133
if (!sdesc)
134134
return ERR_PTR(-ENOMEM);
135135
sdesc->shash.tfm = alg;
136-
sdesc->shash.flags = 0x0;
137136
return sdesc;
138137
}
139138

arch/arm/crypto/aes-neonbs-glue.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ static int __xts_crypt(struct skcipher_request *req,
278278
int err;
279279

280280
err = skcipher_walk_virt(&walk, req, true);
281+
if (err)
282+
return err;
281283

282284
crypto_cipher_encrypt_one(ctx->tweak_tfm, walk.iv, walk.iv);
283285

arch/arm/crypto/chacha-neon-glue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <crypto/algapi.h>
2323
#include <crypto/chacha.h>
24+
#include <crypto/internal/simd.h>
2425
#include <crypto/internal/skcipher.h>
2526
#include <linux/kernel.h>
2627
#include <linux/module.h>
@@ -93,7 +94,7 @@ static int chacha_neon(struct skcipher_request *req)
9394
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
9495
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
9596

96-
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !may_use_simd())
97+
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !crypto_simd_usable())
9798
return crypto_chacha_crypt(req);
9899

99100
return chacha_neon_stream_xor(req, ctx, req->iv);
@@ -107,7 +108,7 @@ static int xchacha_neon(struct skcipher_request *req)
107108
u32 state[16];
108109
u8 real_iv[16];
109110

110-
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !may_use_simd())
111+
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !crypto_simd_usable())
111112
return crypto_xchacha_crypt(req);
112113

113114
crypto_chacha_init(state, ctx, req->iv);

arch/arm/crypto/crc32-ce-glue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/string.h>
1717

1818
#include <crypto/internal/hash.h>
19+
#include <crypto/internal/simd.h>
1920

2021
#include <asm/hwcap.h>
2122
#include <asm/neon.h>
@@ -113,7 +114,7 @@ static int crc32_pmull_update(struct shash_desc *desc, const u8 *data,
113114
u32 *crc = shash_desc_ctx(desc);
114115
unsigned int l;
115116

116-
if (may_use_simd()) {
117+
if (crypto_simd_usable()) {
117118
if ((u32)data % SCALE_F) {
118119
l = min_t(u32, length, SCALE_F - ((u32)data % SCALE_F));
119120

@@ -147,7 +148,7 @@ static int crc32c_pmull_update(struct shash_desc *desc, const u8 *data,
147148
u32 *crc = shash_desc_ctx(desc);
148149
unsigned int l;
149150

150-
if (may_use_simd()) {
151+
if (crypto_simd_usable()) {
151152
if ((u32)data % SCALE_F) {
152153
l = min_t(u32, length, SCALE_F - ((u32)data % SCALE_F));
153154

arch/arm/crypto/crct10dif-ce-glue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/string.h>
1616

1717
#include <crypto/internal/hash.h>
18+
#include <crypto/internal/simd.h>
1819

1920
#include <asm/neon.h>
2021
#include <asm/simd.h>
@@ -36,7 +37,7 @@ static int crct10dif_update(struct shash_desc *desc, const u8 *data,
3637
{
3738
u16 *crc = shash_desc_ctx(desc);
3839

39-
if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && may_use_simd()) {
40+
if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && crypto_simd_usable()) {
4041
kernel_neon_begin();
4142
*crc = crc_t10dif_pmull(*crc, data, length);
4243
kernel_neon_end();

arch/arm/crypto/ghash-ce-glue.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <asm/unaligned.h>
1515
#include <crypto/cryptd.h>
1616
#include <crypto/internal/hash.h>
17+
#include <crypto/internal/simd.h>
1718
#include <crypto/gf128mul.h>
1819
#include <linux/cpufeature.h>
1920
#include <linux/crypto.h>
@@ -185,7 +186,6 @@ static int ghash_async_init(struct ahash_request *req)
185186
struct crypto_shash *child = cryptd_ahash_child(cryptd_tfm);
186187

187188
desc->tfm = child;
188-
desc->flags = req->base.flags;
189189
return crypto_shash_init(desc);
190190
}
191191

@@ -196,7 +196,7 @@ static int ghash_async_update(struct ahash_request *req)
196196
struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
197197
struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
198198

199-
if (!may_use_simd() ||
199+
if (!crypto_simd_usable() ||
200200
(in_atomic() && cryptd_ahash_queued(cryptd_tfm))) {
201201
memcpy(cryptd_req, req, sizeof(*req));
202202
ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
@@ -214,7 +214,7 @@ static int ghash_async_final(struct ahash_request *req)
214214
struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm);
215215
struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
216216

217-
if (!may_use_simd() ||
217+
if (!crypto_simd_usable() ||
218218
(in_atomic() && cryptd_ahash_queued(cryptd_tfm))) {
219219
memcpy(cryptd_req, req, sizeof(*req));
220220
ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
@@ -232,7 +232,7 @@ static int ghash_async_digest(struct ahash_request *req)
232232
struct ahash_request *cryptd_req = ahash_request_ctx(req);
233233
struct cryptd_ahash *cryptd_tfm = ctx->cryptd_tfm;
234234

235-
if (!may_use_simd() ||
235+
if (!crypto_simd_usable() ||
236236
(in_atomic() && cryptd_ahash_queued(cryptd_tfm))) {
237237
memcpy(cryptd_req, req, sizeof(*req));
238238
ahash_request_set_tfm(cryptd_req, &cryptd_tfm->base);
@@ -242,7 +242,6 @@ static int ghash_async_digest(struct ahash_request *req)
242242
struct crypto_shash *child = cryptd_ahash_child(cryptd_tfm);
243243

244244
desc->tfm = child;
245-
desc->flags = req->base.flags;
246245
return shash_ahash_digest(req, desc);
247246
}
248247
}
@@ -255,7 +254,6 @@ static int ghash_async_import(struct ahash_request *req, const void *in)
255254
struct shash_desc *desc = cryptd_shash_desc(cryptd_req);
256255

257256
desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm);
258-
desc->flags = req->base.flags;
259257

260258
return crypto_shash_import(desc, in);
261259
}

arch/arm/crypto/nhpoly1305-neon-glue.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <asm/neon.h>
1010
#include <asm/simd.h>
1111
#include <crypto/internal/hash.h>
12+
#include <crypto/internal/simd.h>
1213
#include <crypto/nhpoly1305.h>
1314
#include <linux/module.h>
1415

@@ -25,7 +26,7 @@ static void _nh_neon(const u32 *key, const u8 *message, size_t message_len,
2526
static int nhpoly1305_neon_update(struct shash_desc *desc,
2627
const u8 *src, unsigned int srclen)
2728
{
28-
if (srclen < 64 || !may_use_simd())
29+
if (srclen < 64 || !crypto_simd_usable())
2930
return crypto_nhpoly1305_update(desc, src, srclen);
3031

3132
do {

arch/arm/crypto/sha1-ce-glue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <crypto/internal/hash.h>
12+
#include <crypto/internal/simd.h>
1213
#include <crypto/sha.h>
1314
#include <crypto/sha1_base.h>
1415
#include <linux/cpufeature.h>
@@ -33,7 +34,7 @@ static int sha1_ce_update(struct shash_desc *desc, const u8 *data,
3334
{
3435
struct sha1_state *sctx = shash_desc_ctx(desc);
3536

36-
if (!may_use_simd() ||
37+
if (!crypto_simd_usable() ||
3738
(sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE)
3839
return sha1_update_arm(desc, data, len);
3940

@@ -47,7 +48,7 @@ static int sha1_ce_update(struct shash_desc *desc, const u8 *data,
4748
static int sha1_ce_finup(struct shash_desc *desc, const u8 *data,
4849
unsigned int len, u8 *out)
4950
{
50-
if (!may_use_simd())
51+
if (!crypto_simd_usable())
5152
return sha1_finup_arm(desc, data, len, out);
5253

5354
kernel_neon_begin();

arch/arm/crypto/sha1_neon_glue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
#include <crypto/internal/hash.h>
22+
#include <crypto/internal/simd.h>
2223
#include <linux/init.h>
2324
#include <linux/module.h>
2425
#include <linux/mm.h>
@@ -39,7 +40,7 @@ static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
3940
{
4041
struct sha1_state *sctx = shash_desc_ctx(desc);
4142

42-
if (!may_use_simd() ||
43+
if (!crypto_simd_usable() ||
4344
(sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE)
4445
return sha1_update_arm(desc, data, len);
4546

@@ -54,7 +55,7 @@ static int sha1_neon_update(struct shash_desc *desc, const u8 *data,
5455
static int sha1_neon_finup(struct shash_desc *desc, const u8 *data,
5556
unsigned int len, u8 *out)
5657
{
57-
if (!may_use_simd())
58+
if (!crypto_simd_usable())
5859
return sha1_finup_arm(desc, data, len, out);
5960

6061
kernel_neon_begin();

arch/arm/crypto/sha2-ce-glue.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include <crypto/internal/hash.h>
12+
#include <crypto/internal/simd.h>
1213
#include <crypto/sha.h>
1314
#include <crypto/sha256_base.h>
1415
#include <linux/cpufeature.h>
@@ -34,7 +35,7 @@ static int sha2_ce_update(struct shash_desc *desc, const u8 *data,
3435
{
3536
struct sha256_state *sctx = shash_desc_ctx(desc);
3637

37-
if (!may_use_simd() ||
38+
if (!crypto_simd_usable() ||
3839
(sctx->count % SHA256_BLOCK_SIZE) + len < SHA256_BLOCK_SIZE)
3940
return crypto_sha256_arm_update(desc, data, len);
4041

@@ -49,7 +50,7 @@ static int sha2_ce_update(struct shash_desc *desc, const u8 *data,
4950
static int sha2_ce_finup(struct shash_desc *desc, const u8 *data,
5051
unsigned int len, u8 *out)
5152
{
52-
if (!may_use_simd())
53+
if (!crypto_simd_usable())
5354
return crypto_sha256_arm_finup(desc, data, len, out);
5455

5556
kernel_neon_begin();

0 commit comments

Comments
 (0)