From nobody Wed Sep 23 02:55:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=aspeedtech.com); dmarc=pass(p=quarantine dis=none) header.from=aspeedtech.com ARC-Seal: i=2; a=rsa-sha256; t=1784086670; cv=pass; d=zohomail.com; s=zohoarc; b=WwSu0AykdSa17y3tcxK1CSsUb/2rZhTijx4rHsG8EOX9jLQv4g3ZBrzcNHyVhz5zcacgZi5BexRhkiDtzC91JcDoYyQCaWmw8yoA7VeQAun1NCjgQdEkjRrMR5XbBbK7O2obBJgh+r524h2rJaZFlIC/C2bFviQCH3Cxz7WkQ9A= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784086670; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cac0a6Uep3e3shBIHUrm9AMlDFZQ9DRl10gs5CRpiNw=; b=VwUby5rElcwtgOuN7vXwVBPWLBh7eUCOASB4ixx/iIekPk9BkOUjBoDJxl4VyVhrxOTZP52DjB95SZyhS/BcFYx0AXe1PF0jc/iD2CNJqVeGeN0wBJISpwp4RxWIlFD98KESm3uvbsKjzxi512MtCZezRH6DwQXkqf8y6U9wyT4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=aspeedtech.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784086670637480.9824214139313; Tue, 14 Jul 2026 20:37:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wjqNZ-0003B4-UA; Tue, 14 Jul 2026 23:33:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjqNN-00037N-BY; Tue, 14 Jul 2026 23:33:39 -0400 Received: from mail-japaneastazlp170120005.outbound.protection.outlook.com ([2a01:111:f403:c405::5] helo=TYPPR03CU001.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjqNL-0000oW-Gr; Tue, 14 Jul 2026 23:33:37 -0400 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by TY0PR06MB5258.apcprd06.prod.outlook.com (2603:1096:400:205::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.11; Wed, 15 Jul 2026 03:33:25 +0000 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3]) by TYZPR06MB4980.apcprd06.prod.outlook.com ([fe80::ea8a:7cb7:4822:2fb3%6]) with mapi id 15.21.0223.008; Wed, 15 Jul 2026 03:33:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SNtvnh0mCSDYLUeVvAiAKoEC17b/6Q6JTI/r8grcWVIBMhzU0MbMECrVaz5bmZ32SjEiN/wL/Apg4DKUtU826XI37g6e/ncKnEkupUU1JuOw4wz4l7cKLGdiqUaHTWBjSPnYZqNU/lddkGIyKlBCTflYy7ldZght2xnpZRJB4tDiF6xegNBVIBY+5GSATp7/pe+jfk+5Z9a5Ti+NojMlchMjR0KWMzsu6qfGIv034UxSBwXAnSbBayyg5vfdn3ZNHmNKmoPLmX1aVJtOsTAPmobe1HhJCHov/pEPicg7WS+tC/3UJP8otiyRpPR0crHJ30YIERir24F/hRaTU0+bfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cac0a6Uep3e3shBIHUrm9AMlDFZQ9DRl10gs5CRpiNw=; b=eC9CNLbPa6z6cMxAk94gXXECPO+itSUY6HVQ70Z6CXD+z2GhNtFBiq+6Ii100UKiKQ+kB1hr9i9g7syJfyx+rHrRwPOD/w1cDwgLxiSorczAcvEBpP1mL0FHNFJfdGHIUylkfPLj+0pqu0cvxFcli6koPXIJ5FkzT+TUzLNjXEeyzxeyHVsVhSksuecOoMZeGMcZ2DaINR6JSpXJyzkTzP6mqRxWxEQ0sDBNziyRi9h2Gxyy06Lchuqb959fYYyOHOVbuBy1pSyybV8rxK/VPaK6kyAVHvgpzJYWtQozT7Wv/Li5v6CWa2ODfOTWPFljfJSFfkCNGvONEkm+dlthiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=aspeedtech.com; dmarc=pass action=none header.from=aspeedtech.com; dkim=pass header.d=aspeedtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aspeedtech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cac0a6Uep3e3shBIHUrm9AMlDFZQ9DRl10gs5CRpiNw=; b=r99nMS7U/DH9BtvLZqSgd8g4tl2NhMPO9rtW+DMUxeXLioEcJbThiSrb3ET3P+9PsvSlq1uPzSd6T79RK6pRqE3PCjpgSGZDRxu1zKNwrvepv9Xl8Xy/TfDqKJW590RMKKJC5EF5pe2ff/FxyyTxBJ4tD5CEzkRu3p7/JO5blRmz4CEuYINLu3zJlrN3G5GJ2CdNt8BpeQYbfmhXAzRfUPePLwetq8EI338DrEfXBu4fUDhkB7ZPIG7DyjZde2CHejqJTLNN++ItXqBhfA/qqnGt3SGJKk8T2LmG8mjeR9bln8MW2R5MWXVcIMEH29bujuzHDquc2JAf5ChrWA4gqQ== From: Jamin Lin To: =?iso-8859-1?Q?Daniel_P=2E_Berrang=E9?= , =?iso-8859-1?Q?C=E9dric_Le_Goater?= , Peter Maydell , Steven Lee , Troy Lee , Kane Chen , Andrew Jeffery , Joel Stanley , Eric Blake , Markus Armbruster , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , "open list:All patches CC here" , "open list:ASPEED BMCs" CC: Jamin Lin , Troy Lee Subject: [PATCH v2 08/17] crypto/cipher: Add setaad/gettag for AEAD modes Thread-Topic: [PATCH v2 08/17] crypto/cipher: Add setaad/gettag for AEAD modes Thread-Index: AQHdFAqxWedOU6pRL0Oc6AVs77tDTQ== Date: Wed, 15 Jul 2026 03:33:25 +0000 Message-ID: <20260715033311.1648424-9-jamin_lin@aspeedtech.com> References: <20260715033311.1648424-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260715033311.1648424-1-jamin_lin@aspeedtech.com> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=aspeedtech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYZPR06MB4980:EE_|TY0PR06MB5258:EE_ x-ms-office365-filtering-correlation-id: 6c802112-c5e7-4058-a340-08dee221d41d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|23010399003|56012099006|6133799003|22082099003|18002099003|38070700021|921020; x-microsoft-antispam-message-info: HHaETSkMYhG6lkIre5I0m4ZuDOotas4cbIxCe3D4UqM4BEcHkSn15NL+P+UkfsfZdwI5owJr2y7woOriwhTdmfd37w+eLvXgw3EheN1OenTF+i+P7JunZTafX2MJXgFPcKKYE6jRDNWoMgK+AxKM8WDyZQTs+9tjjWmRLtoTKCxWPNbp/Regi5tlCrD0MFCzLotN++1YfExMdsge79HtxNdBnH388SQwLFbq5UrP2u0+rpYvonKYqLTB5HNyZovX8ztaec2DKHCNK9dlLR8PLe4mDzoaRNX0qVYTQgiYdHQMyK8s379vDFDdbzNV2LgRwMR2JaHZTq9g3eszPVYEgczYF2vKzBzaisO4kIfv2dG7xPkNeNAxVSR9l5pfBhn34WC+BgWDu3Eas6MYO2tSo0yIjdL15MK73xsDw912qBtFUoiL6lFHkLRPvBqdF94pUZlcnOyCpKv+Aops53JCZqTKm6dJDO0+7RLJ/90+cQ3M2YKXypD402HBRAQr3vbPnGF+jLy3r0N8NxJpaW7zC4yrbJMNmYcpylWeO/wf6L6GqiC3/PS/agiXNmJn1Atmnk06zos/1skVbPt8l9Nuo6w0U7I77yT3nBUHoAZK0tcyvZ91mZYDDXtC8JP9odkSjgmrXb2nHtZeJir/0dNnz5qpm2Q5YvqW4COASbm04sjUA3oHVsjRSmZQp0tuWsTpx799W+p8SLK2XjgCFvhOiwNiOpdziPzbFj4WZxwvI6Ep+UCsfVfzQFbpL8Fb+Ke/ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4980.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(7416014)(376014)(23010399003)(56012099006)(6133799003)(22082099003)(18002099003)(38070700021)(921020); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?gQjVxeY5SFg4iXEKXBta0CpWBW/mDEktm7WOiOkTWyo35WUgAvL6TtZ8WR?= =?i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oFwAqq5NQ=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: MpAlRqRKed3t9YcZ1ZxbezrJvcBJ45O7d18mJK429EYP3YxlPUFkQyMcOTcwgdgZQ5Kzua1hO08TBvNknQfg3c4olV1sWzAhlLnV3i4qxLppY7oZBGRYp2tbF97EF5iOUeoowc7BQpXmxfFbE47hkaK5ka9NSw+OT4WqJ4yvmDvv7x67MvLdKXI+utV9HIp92rVkEThaVtQ0gv3D9AZScaPMqXIurakwo3aO1H1Uz3kQMFoUGiSj4nwpvRbbCOl3wmfFehpmDRBOx/LGIk5nJ6+Q9dRvVM9SIYPORjlrVuWNnjGHS1gM9/anue1IOf6n6/+XfeeL+LWCq6Q0YQUesA== X-OriginatorOrg: aspeedtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4980.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c802112-c5e7-4058-a340-08dee221d41d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jul 2026 03:33:25.3216 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43d4aa98-e35b-4575-8939-080e90d5a249 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: SpKm78oceiIHBOGd0CvRB4kmHFYr/fxiJT6phnBkOGUveG4DdMAnylzJtPjHCzmbQqKfly9Ers2N0IZN3aP7UVOScmDlDb9WkeG7r/le4pk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5258 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2a01:111:f403:c405::5; envelope-from=jamin_lin@aspeedtech.com; helo=TYPPR03CU001.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @aspeedtech.com) X-ZM-MESSAGEID: 1784086672741158500 Content-Type: text/plain; charset="utf-8" AEAD modes such as GCM authenticate optional associated data (AAD) and produce an authentication tag, which the block-cipher encrypt/decrypt interface cannot express. Add qcrypto_cipher_setaad() and qcrypto_cipher_gettag() plus the matching backend driver hooks. The generic front-end reports an error when the selected mode's driver does not implement them, so calling them on a non-AEAD mode fails cleanly. Signed-off-by: Jamin Lin Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Kane Chen --- crypto/cipherpriv.h | 8 ++++++++ include/crypto/cipher.h | 36 ++++++++++++++++++++++++++++++++++++ crypto/cipher.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/crypto/cipherpriv.h b/crypto/cipherpriv.h index 64737ce961..c4f995f369 100644 --- a/crypto/cipherpriv.h +++ b/crypto/cipherpriv.h @@ -34,6 +34,14 @@ struct QCryptoCipherDriver { const uint8_t *iv, size_t niv, Error **errp); =20 + int (*cipher_setaad)(QCryptoCipher *cipher, + const uint8_t *aad, size_t len, + Error **errp); + + int (*cipher_gettag)(QCryptoCipher *cipher, + uint8_t *tag, size_t len, + Error **errp); + void (*cipher_free)(QCryptoCipher *cipher); }; =20 diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h index 92939310ef..2e361411b9 100644 --- a/include/crypto/cipher.h +++ b/include/crypto/cipher.h @@ -235,4 +235,40 @@ int qcrypto_cipher_setiv(QCryptoCipher *cipher, const uint8_t *iv, size_t niv, Error **errp); =20 +/** + * qcrypto_cipher_setaad: + * @cipher: the cipher object + * @aad: the associated data to authenticate + * @len: the length of @aad + * @errp: pointer to a NULL-initialized error object + * + * For AEAD modes such as GCM, feed the associated data (AAD) that is + * authenticated but not encrypted. It must be called after + * qcrypto_cipher_setiv() and before the first encrypt/decrypt call. It is + * an error to call this on a mode that is not an AEAD mode. + * + * Returns: 0 on success, -1 on error + */ +int qcrypto_cipher_setaad(QCryptoCipher *cipher, + const uint8_t *aad, size_t len, + Error **errp); + +/** + * qcrypto_cipher_gettag: + * @cipher: the cipher object + * @tag: buffer to receive the authentication tag + * @len: the length of @tag + * @errp: pointer to a NULL-initialized error object + * + * For AEAD modes such as GCM, read back the authentication tag computed + * over the associated data and the message. It must be called after the + * encrypt/decrypt operation. It is an error to call this on a mode that is + * not an AEAD mode. + * + * Returns: 0 on success, -1 on error + */ +int qcrypto_cipher_gettag(QCryptoCipher *cipher, + uint8_t *tag, size_t len, + Error **errp); + #endif /* QCRYPTO_CIPHER_H */ diff --git a/crypto/cipher.c b/crypto/cipher.c index 52d071a90c..67014aad6f 100644 --- a/crypto/cipher.c +++ b/crypto/cipher.c @@ -205,6 +205,37 @@ int qcrypto_cipher_setiv(QCryptoCipher *cipher, } =20 =20 +int qcrypto_cipher_setaad(QCryptoCipher *cipher, + const uint8_t *aad, size_t len, + Error **errp) +{ + const QCryptoCipherDriver *drv =3D cipher->driver; + + if (!drv->cipher_setaad) { + error_setg(errp, "The cipher mode does not support associated data= "); + return -1; + } + + return drv->cipher_setaad(cipher, aad, len, errp); +} + + +int qcrypto_cipher_gettag(QCryptoCipher *cipher, + uint8_t *tag, size_t len, + Error **errp) +{ + const QCryptoCipherDriver *drv =3D cipher->driver; + + if (!drv->cipher_gettag) { + error_setg(errp, + "The cipher mode does not produce an authentication tag= "); + return -1; + } + + return drv->cipher_gettag(cipher, tag, len, errp); +} + + void qcrypto_cipher_free(QCryptoCipher *cipher) { if (cipher) { --=20 2.43.0