From patchwork Sat Jun 22 19:34:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 167489 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2255890ilk; Sat, 22 Jun 2019 12:34:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXESPo01xV5PIL203RSkAJFMtkC8DWI7b5I1/YXWxefuo8VJICagb2OaB5AGtkufV9R/hn X-Received: by 2002:a63:e151:: with SMTP id h17mr2085743pgk.307.1561232091505; Sat, 22 Jun 2019 12:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561232091; cv=none; d=google.com; s=arc-20160816; b=Zx5yTTIA82ANfb066lPncvTAtzlzywq9B2j+D5apgDez5iMjP/Gps9O1OX7NOiU8c/ PTHQJKmr9PJPTNapsYnvcvZ44O4WmtqenO9D/k489sXIAhynJbaUx/4E1rEodpNjve00 /ZmQBR6kbdZ4OK+yRpza3K3sWKv+tp/TXra2owKEPQCP0xhNuPJo1xHaMYOwon6EneXT qkhrN+QyU5XZIpB4Ogjw/Z4P8hM5hIre8TrpJ0OGMr2rV0XYaw3Soc0IwkG1oeNNBD/D LvSQLGOSmxywZBIHkcFxlmotXFZSsOBAed/YjXeyVAHjJ+0NcfcHzKlLWBO4rL+uGHO/ 7Hvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QMunKwfP+ecJeJsjLgotGX9cYxNfDTWVUzGiozUxkpA=; b=q5dZ0NdaUBfODnEOTLzeeOq0xvA81HXAd4ZcAR44HF0RKDiyZ5g7stz5b7bKR3z2O3 u7FGbd4AOxSWUjZPp0t48Ey6U+RxwiFUZc46wAVhT/5MTsQTInXDH6KehCeotU4i69vG mdtlr1Ot1gt3XpWTFmpv0Upy0K5NbdNLRtSy5eenqAvu4IHpMevKx+hnMUwf8/M0vo7j 7rd/kxll3O2Yb0kduFOZbN9muEeDB5DSW++0hzt8PQV1NqNv0GK/hQmbSBIKbmmS19kG 0xuzx+Ep0+CKbVzOt66sS/H7cfL88zKCuWYwaetkwL2wJKC1DAeTvEQ2tkpuL/xYGbre m7Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HRL4wYu2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si5511699pgb.409.2019.06.22.12.34.51; Sat, 22 Jun 2019 12:34:51 -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=pass header.i=@linaro.org header.s=google header.b=HRL4wYu2; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726290AbfFVTeu (ORCPT + 3 others); Sat, 22 Jun 2019 15:34:50 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53471 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726338AbfFVTeu (ORCPT ); Sat, 22 Jun 2019 15:34:50 -0400 Received: by mail-wm1-f67.google.com with SMTP id x15so9147968wmj.3 for ; Sat, 22 Jun 2019 12:34:48 -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 :mime-version:content-transfer-encoding; bh=QMunKwfP+ecJeJsjLgotGX9cYxNfDTWVUzGiozUxkpA=; b=HRL4wYu2j3ZC8ztFcw5jusvcO70KmvcLgz/loyCoCvT4/QqUZ2KGzp4oEzGr6zSvQP z9uBHfwDsrks9peolBIaZ3LI7xvxLkZW8NK+vEhm5HXBiLD05vCph9smlQ1zLtrSmFLi GZNqkbrPsxSj1r1XFjIZe+0OyMC/eiPbT0DzXSwYLMFi+NcoB+arPCwqUhgaIIl3j/IY TY2Q17mbD/wxjM7wJfxfOx2+fC8gahXqf6TMdvlDjXmih9XU/jI427uc6o0TQjwuRZch wgy0iieM62PaOoZX++/M92IbZ53JtpBrwUBMeqB+bMygBWuRip3zZdJH/ZbQDgsnMt9H anYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QMunKwfP+ecJeJsjLgotGX9cYxNfDTWVUzGiozUxkpA=; b=lxXPpdAxpSPGjm8Il1VUqUTD9sHEBDmRgsPan42HnEeIwytr98TpQ907nP0TPuLlvW Ra46grIWj733jPv5HkBLwW/vUR+29Sbp7Mkmd+Y3wW/zrI/6hrmf6bKG25OY4zrcMLOA 1EZFmwY7H2MM0+LmnaoZjf59J1bEDtLiuS1QseAPNrEIkaTVzVBPxE6XpIgFdoW9pWXR 0X0THwk2yrqjFusjP86RkPygyzji9zpWFdSlh22w46I5J1UGX1kxGndsq9RC1MvY6Jxj 0iDp+APt0NVqePR7Y/x+9sfNPxyx4+oIBpfNPnIBNiptHiYrwnZdut6Fu6gPXT6tKN1S L3TA== X-Gm-Message-State: APjAAAUa1ZEP6dqHSqKQtuV0pme7AefJJ+WhWALZDR6XAkjWogOnGtqG ge0DKQM24p3A+wwXqgfOuBHOTCBzPxz4yMei X-Received: by 2002:a05:600c:28d:: with SMTP id 13mr8899720wmk.5.1561232087743; Sat, 22 Jun 2019 12:34:47 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:4bd:3f91:4ef8:ae7e]) by smtp.gmail.com with ESMTPSA id h8sm4814494wmf.12.2019.06.22.12.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Jun 2019 12:34:47 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@google.com, Ard Biesheuvel Subject: [PATCH v2 07/26] crypto: padlock/aes - switch to library version of key expansion routine Date: Sat, 22 Jun 2019 21:34:08 +0200 Message-Id: <20190622193427.20336-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622193427.20336-1-ard.biesheuvel@linaro.org> References: <20190622193427.20336-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- drivers/crypto/Kconfig | 2 +- drivers/crypto/padlock-aes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 67af688d7d84..3fca5f7e38f0 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -26,7 +26,7 @@ config CRYPTO_DEV_PADLOCK_AES tristate "PadLock driver for AES algorithm" depends on CRYPTO_DEV_PADLOCK select CRYPTO_BLKCIPHER - select CRYPTO_AES + select CRYPTO_LIB_AES help Use VIA PadLock for AES algorithm. diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index 854539512c35..af90138eddb7 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c @@ -144,7 +144,7 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key, ctx->cword.encrypt.keygen = 1; ctx->cword.decrypt.keygen = 1; - if (crypto_aes_expand_key(&gen_aes, in_key, key_len)) { + if (aes_expandkey(&gen_aes, in_key, key_len)) { *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; return -EINVAL; }