From patchwork Mon Aug 29 11:19:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 74894 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1577813qga; Mon, 29 Aug 2016 04:20:22 -0700 (PDT) X-Received: by 10.98.57.90 with SMTP id g87mr31531611pfa.106.1472469622170; Mon, 29 Aug 2016 04:20:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si38779458pfb.98.2016.08.29.04.20.22; Mon, 29 Aug 2016 04:20: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 S932609AbcH2LUS (ORCPT + 1 other); Mon, 29 Aug 2016 07:20:18 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35400 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932346AbcH2LUS (ORCPT ); Mon, 29 Aug 2016 07:20:18 -0400 Received: by mail-wm0-f50.google.com with SMTP id f65so73932395wmi.0 for ; Mon, 29 Aug 2016 04:20:17 -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; bh=pInDUhV4xAjSSHMYnFeF4WHlOugzIYKL0+OtiTmqr2o=; b=ZPMHbKQcKfseq3WwDkovphv9vbQ4+wdEpDCXrri5m2MVvnLNChmIk15J6UWfvFzSc9 epWcLXSqb3cw/pup5SrqZkexvW4fMmum+wAmNjjkTEmyuS/c0ZLuIUTzxkZZvRltuXJa 2KIPZtn6wQPq3CVTW5du/1C/EiSESqd2GoIpU= 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; bh=pInDUhV4xAjSSHMYnFeF4WHlOugzIYKL0+OtiTmqr2o=; b=KwJO+idkQ6DJjDQJF+q7ikkQf+/0u/sBvLK0U7EILpBg9ZvePmDsWiiqEeEn+5ooOz BfHX4XQY+SA75E8chz10sV3S6BebHxb8VkE8x8gNeF8osi/Fqcr4lkDogtFYMaVMa8Ve y3XoLWLwkDBGzSKF9EOP+Wk6c1Eb9knD771yxsURNMkvESxbDE1fRxPwArWTi1ncoC9e gCqO68M6eiM7s4v2WQ3WcH3DvwVmruiD9AVJr8wCR4A6Hw1E7WT9rQjNzzPi1HgcxPms z5i26GvVMr9RKNUOCupxvPmilqyMYXfZokPqb+nYmHEVeMKLv7+khXJezTQK4Gsj/u5O YO+Q== X-Gm-Message-State: AE9vXwM9L/j6XA7rC6R6rxU1UfoEj09zzujdA2N1U8nmSuR/7wCrBUUO3FYquQnXSw7BGED/ X-Received: by 10.28.107.88 with SMTP id g85mr10718191wmc.49.1472469616760; Mon, 29 Aug 2016 04:20:16 -0700 (PDT) Received: from localhost.localdomain ([197.130.174.124]) by smtp.gmail.com with ESMTPSA id p1sm33887208wjd.37.2016.08.29.04.20.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Aug 2016 04:20:15 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: Ard Biesheuvel Subject: [PATCH 1/2] crypto: arm/ghash-ce - add missing async import/export Date: Mon, 29 Aug 2016 12:19:53 +0100 Message-Id: <1472469594-27315-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 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 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 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..212aaa715fdb 100644 --- a/arch/arm/crypto/ghash-ce-glue.c +++ b/arch/arm/crypto/ghash-ce-glue.c @@ -220,6 +220,29 @@ 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 shash_desc *desc = cryptd_shash_desc(cryptd_req); + struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); + + ghash_async_init(req); + + *dctx = *(const struct ghash_desc_ctx *)in; + return 0; + +} + +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); + struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); + + *(struct ghash_desc_ctx *)out = *dctx; + return 0; +} + static int ghash_async_setkey(struct crypto_ahash *tfm, const u8 *key, unsigned int keylen) { @@ -268,7 +291,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",