From patchwork Thu Sep 1 13:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 75213 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp299235qga; Thu, 1 Sep 2016 06:27:23 -0700 (PDT) X-Received: by 10.98.200.29 with SMTP id z29mr26500143pff.143.1472736442940; Thu, 01 Sep 2016 06:27:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4si5762771pfa.54.2016.09.01.06.27.22; Thu, 01 Sep 2016 06:27:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755011AbcIAN1V (ORCPT + 1 other); Thu, 1 Sep 2016 09:27:21 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:36846 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754929AbcIAN1U (ORCPT ); Thu, 1 Sep 2016 09:27:20 -0400 Received: by mail-wm0-f49.google.com with SMTP id c133so78460701wmd.1 for ; Thu, 01 Sep 2016 06:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0GIsdiWn/6x8KrhpWrRkoBUjcl7lXnYLARXsHG7wXXY=; b=iW33K0iUHgqNHBRmvnedLpbB6kmpdswX1ls0nih+EdKVearzg/s3sS3DbMeDJlvVcV sgzC9vASiuq5lX/oIjmFa364sdRH7vb3xtgnIkh01uGxQd24xVm+ihPj/fP6yy+SRV4U 36nyVQrW0NwNJexYjDIiTc5BamoQbO/OTJryg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0GIsdiWn/6x8KrhpWrRkoBUjcl7lXnYLARXsHG7wXXY=; b=VFhZM6QE2qA7e0nglvqQBHfmb4dBERKt7QtpFgXIgJtOvh3+zHWwwjahdsvpKYI2py 6uvoXicwjnV3tGAlvDaL1+6hi473gb4CpTci99pBnXhVXXrefk0cKU2DJk8pNE7c36G7 0BuOkl6IxdSiVjobGjaCHveoa2Ham68qdDzLbpnO/V6+TrhcamQn6im+AeL/yOO4Eg2s 7k0ZToVzEJPPIyMcYkLQn0Pp40FHSmaR7o3aGxaAMr+Umh0eqPqdjfXVwdTeKaG3cwFY Olp2dnxJrp6nd/jEJU/Ops2gY2yH+uw4IkgS+bzgj1Xc+kk3f4HMAH/yEY8ZCP+Q9nbp SHPg== X-Gm-Message-State: AE9vXwPGQbxxE86XaM/D7Wji/oUZS25t8BuxI4Nf4ccapTFphdeK5AfOBYQD+ik0kDPiMSRQ X-Received: by 10.194.75.225 with SMTP id f1mr14074825wjw.104.1472736437869; Thu, 01 Sep 2016 06:27:17 -0700 (PDT) Received: from localhost.localdomain ([105.147.72.48]) by smtp.gmail.com with ESMTPSA id e5sm29182678wma.13.2016.09.01.06.27.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 06:27:17 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: Ard Biesheuvel Subject: [PATCH v2 2/3] crypto: arm/ghash-ce - add missing async import/export Date: Thu, 1 Sep 2016 14:25:42 +0100 Message-Id: <1472736343-15305-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472736343-15305-1-git-send-email-ard.biesheuvel@linaro.org> References: <1472736343-15305-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- arch/arm/crypto/ghash-ce-glue.c | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) } } +static int ghash_async_import(struct ahash_request *req, const void *in) +{ + struct ahash_request *cryptd_req = ahash_request_ctx(req); + struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); + struct ghash_async_ctx *ctx = crypto_ahash_ctx(tfm); + struct shash_desc *desc = cryptd_shash_desc(cryptd_req); + + desc->tfm = cryptd_ahash_child(ctx->cryptd_tfm); + desc->flags = req->base.flags; + + return crypto_shash_import(desc, in); +} + +static int ghash_async_export(struct ahash_request *req, void *out) +{ + struct ahash_request *cryptd_req = ahash_request_ctx(req); + struct shash_desc *desc = cryptd_shash_desc(cryptd_req); + + return crypto_shash_export(desc, out); +} + static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen) { @@ -268,7 +289,10 @@ static struct ahash_alg ghash_async_alg = { .final = ghash_async_final, .setkey = ghash_async_setkey, .digest = ghash_async_digest, + .import = ghash_async_import, + .export = ghash_async_export, .halg.digestsize = GHASH_DIGEST_SIZE, + .halg.statesize = sizeof(struct ghash_desc_ctx), .halg.base = { .cra_name = "ghash", .cra_driver_name = "ghash-ce",