From nobody Tue Jan 11 22:38:10 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1ABFF194C24B; Tue, 11 Jan 2022 22:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JYQZW1Qbqz4lyC; Tue, 11 Jan 2022 22:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 961D921C17; Tue, 11 Jan 2022 22:38:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20BMcAqA075858; Tue, 11 Jan 2022 22:38:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20BMcAJn075857; Tue, 11 Jan 2022 22:38:10 GMT (envelope-from git) Date: Tue, 11 Jan 2022 22:38:10 GMT Message-Id: <202201112238.20BMcAJn075857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b15636233845 - main - geliboot: Use the multi-block functions for AES-XTS. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b156362338456023956446f0f354ad8b3a35e5ad Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641940691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W0uFtixJa7y8ZfRRZQ0Nie5VYPFVt9sZZJhSDC4Y0v0=; b=cTm95SitWtPLzyezpOcQfT4mXdNmdiBY1e1nH8CgT7nUHQt7ZLBKHh+BeTY0kHLSmNOTXZ EjXu/7roAAvq+Z3OewAzpX9qbWX42SQuVuIHrF0W1GY/02q6bvBWn7deK+Nl3G0QzuHvmD DQsyDZVgY85jgqrPhXtsbYPwJvl0NM0bdBHkMQTC1U/ylS5UnPg7TEhEi7rwjYL6iLzot4 GGxyM+5WreKmYGUSjLwrEuRo46Jw4DV8WmGhr/6JzxQ5O0HrbSQZPjwQ8PaD6jXzUG0NmL chzHQfTOr1PheGW21AqL8MUyjAb7Vzp9m84styhVWwZJ/ZWtcFyx9BztD2V6Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641940691; a=rsa-sha256; cv=none; b=hc72JlGs3MHBL+b+U1TWzI6zz/1vAXsk2GSYEzBUawKGHSu6ePV1Q3/MqUsW+wSdIoj/qW Hqn9RvFjd/cEFGLScukRG6at6axosQlTjf2LEFOcawp5aZiufOO0T8S8kcQI4qNfYQTC3z A46vfldqoSxTHs284QcZT2b8pWg2V1PlUuLrlKTRiLiwlZElh030hNXEwNA1j48rOKR4sK pich8Q9KBv96JwveyKz/Y0pGBPsyjPucF4Impx+6a/vrpWWUjoG0KRuYRx6Htd9hNLEvy8 uoA0D0l1o5o1tRhm+N00ltrLn8GzcGsDOxj5RQzfIpmk7mQ4Q1T/E4f+6890rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b156362338456023956446f0f354ad8b3a35e5ad commit b156362338456023956446f0f354ad8b3a35e5ad Author: John Baldwin AuthorDate: 2022-01-11 22:18:12 +0000 Commit: John Baldwin CommitDate: 2022-01-11 22:18:12 +0000 geliboot: Use the multi-block functions for AES-XTS. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33530 --- stand/libsa/geli/geliboot_crypto.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/stand/libsa/geli/geliboot_crypto.c b/stand/libsa/geli/geliboot_crypto.c index fcc5d7bcd7fb..766f908d9037 100644 --- a/stand/libsa/geli/geliboot_crypto.c +++ b/stand/libsa/geli/geliboot_crypto.c @@ -42,7 +42,7 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, cipherInstance cipher; struct aes_xts_ctx xtsctx, *ctxp; size_t xts_len; - int err, blks, i; + int err, blks; switch (algo) { case CRYPTO_AES_CBC: @@ -85,16 +85,12 @@ geliboot_crypt(u_int algo, geli_op_t enc, u_char *data, size_t datasize, switch (enc) { case GELI_DECRYPT: - for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.decrypt(ctxp, data + i, - data + i); - } + enc_xform_aes_xts.decrypt_multi(ctxp, data, data, + datasize); break; case GELI_ENCRYPT: - for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { - enc_xform_aes_xts.encrypt(ctxp, data + i, - data + i); - } + enc_xform_aes_xts.encrypt_multi(ctxp, data, data, + datasize); break; } break;