diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-09-01 09:25:42 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-09-07 09:08:30 -0400 |
commit | ed4767d612fd2c39e2c4c69eba484c1219dcddb6 (patch) | |
tree | 3696e493b88e27907b7ac0b9ef973d4a5fd0890d /arch/arm | |
parent | 2117eaa62aa92776d1465abcfaa5becfd8eaf3f9 (diff) |
crypto: arm/ghash-ce - add missing async import/export
Since commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero"),
all ahash drivers are required to implement import()/export(), and must have
a non-zero statesize. Fix this for the ARM Crypto Extensions GHASH
implementation.
Fixes: 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/crypto/ghash-ce-glue.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/crypto/ghash-ce-glue.c b/arch/arm/crypto/ghash-ce-glue.c index 1568cb5cd870..b88364aa149a 100644 --- a/arch/arm/crypto/ghash-ce-glue.c +++ b/arch/arm/crypto/ghash-ce-glue.c | |||
@@ -220,6 +220,27 @@ static int ghash_async_digest(struct ahash_request *req) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | static int ghash_async_import(struct ahash_request *req, const void *in) | ||
224 | { | ||
225 | struct ahash_request *cryptd_req = ahash_request_ctx(req); | ||
226 | struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); | ||
227 | struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); | ||
228 | struct shash_desc *desc = cryptd_shash_desc(cryptd_req); | ||
229 | |||
230 | desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm); | ||
231 | desc->flags = req->base.flags; | ||
232 | |||
233 | return crypto_shash_import(desc, in); | ||
234 | } | ||
235 | |||
236 | static int ghash_async_export(struct ahash_request *req, void *out) | ||
237 | { | ||
238 | struct ahash_request *cryptd_req = ahash_request_ctx(req); | ||
239 | struct shash_desc *desc = cryptd_shash_desc(cryptd_req); | ||
240 | |||
241 | return crypto_shash_export(desc, out); | ||
242 | } | ||
243 | |||
223 | static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, | 244 | static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, |
224 | unsigned int keylen) | 245 | unsigned int keylen) |
225 | { | 246 | { |
@@ -268,7 +289,10 @@ static struct ahash_alg ghash_async_alg = { | |||
268 | .final = ghash_async_final, | 289 | .final = ghash_async_final, |
269 | .setkey = ghash_async_setkey, | 290 | .setkey = ghash_async_setkey, |
270 | .digest = ghash_async_digest, | 291 | .digest = ghash_async_digest, |
292 | .import = ghash_async_import, | ||
293 | .export = ghash_async_export, | ||
271 | .halg.digestsize = GHASH_DIGEST_SIZE, | 294 | .halg.digestsize = GHASH_DIGEST_SIZE, |
295 | .halg.statesize = sizeof(struct ghash_desc_ctx), | ||
272 | .halg.base = { | 296 | .halg.base = { |
273 | .cra_name = "ghash", | 297 | .cra_name = "ghash", |
274 | .cra_driver_name = "ghash-ce", | 298 | .cra_driver_name = "ghash-ce", |