From nobody Wed Sep 23 05:43:02 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=1784014214; cv=pass; d=zohomail.com; s=zohoarc; b=X16BVayZjbj2cXZZFBOn/YulNuKSbLG+ygUiweFhyktv/ChB2SGltWhs/gtdW7Yjvi58YqDOKW5EkPeycdOS4gSxrNtO9m6WNim4Orfj8c0foj+UjZ5Ix4Ecr3gbXOoUrCGCU/sNVGYnk/69t9VWx7VPXpltKZTvifBsZ405gXI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784014214; 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=cHDOcYpSQCeiBu0DGhdVsdWJkNeDlZ6zM+BxWOrBJZE=; b=guvv2+W+2ECXAiaez0YX7/WQZP2wqVL//ayLKHog04i1gKylQo7XVSCibZP9P664La0dmFhI7reiRJKdOdgZBADndYKG3N9AFAy0Whz7j6UUrumIb7OGkg+QOrK/NctEfAakeZLQIHkn+HKB2De4OgVw4l+VRJ5vIbWfjkhQmRU= 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 1784014213754144.96117932991956; Tue, 14 Jul 2026 00:30:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wjXa8-0005rT-6R; Tue, 14 Jul 2026 03:29:32 -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 1wjXa4-0005qI-H6; Tue, 14 Jul 2026 03:29:28 -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 1wjXa2-0006WV-MY; Tue, 14 Jul 2026 03:29:28 -0400 Received: from TYZPR06MB4980.apcprd06.prod.outlook.com (2603:1096:400:1cc::10) by SEZPR06MB6117.apcprd06.prod.outlook.com (2603:1096:101:f3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.202.18; Tue, 14 Jul 2026 07:29:13 +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.0202.014; Tue, 14 Jul 2026 07:29:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cpwrjHydfe+nqZz/Lievl9HB2pVdRKKtpydWC4H5T1nRSSCCOGnyXF+f6J6G9RBV5OYokr6dJDdD4roc3U50O1oS0qvr/LDnaGmXCarUqWYHUOfybr3g0KKdfgEZvUCmxRrzGT5wwgG7s3n/2X9jIRU9lQozSK0EWk9tvB4161YpB8+6tV5oqRbwjG2mbJzXq9OLKeiSzxNqQPBMdsnagdW+hVlLDVx5j95j986hQ29228J93elNF5uSEU6FxmZyYn0SVKQ73RlDg/e4osqN7iuvWNDzI3z7mNBYCRJvYEDQrDgra1AuDfSjqcMlOnd/14G3zbyVamsk2O5RtHmznA== 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=cHDOcYpSQCeiBu0DGhdVsdWJkNeDlZ6zM+BxWOrBJZE=; b=wbA6oGiyRG2yOp2ZL6QhinN5YIQxYY2a4xvR/XOlwpQHDOPjkJd4tnqZXUCOGkI5l0s93miq7k/Lj7f6zZzH5XJaTV6dtPF93go7VpIBr3ijoGFHClNpf0VhzJouCpfEH2we71x4ZSY+Xb3D9/k2KNXX9RC5UamX4JzFJreCgcKDW7Dl8MnriM0AYDOzR/vOkDneOVCpuk4BpffgM7VjsYQxWIZDpNpEZWPp+J/d/nf1WWmLakVxrDKgT8TuUhk8IBTNB8pdn658+jvAZ9gPkyQ2lxkE86gP7ti+KHYtS29VyDPzGpSId3eMY9WVOx+K2A63VARuIWp2Rmju7iu81A== 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=cHDOcYpSQCeiBu0DGhdVsdWJkNeDlZ6zM+BxWOrBJZE=; b=ieURE2zfVoSDD4hy/alWm86byKIwaGUp4KIRpEUwR5KLVI0jCeqGmcWk85ljgL+e2Npw5FR8IUhjY4EKQlOv+ycD3emwMlbNA2fugK8Y97K2nkAV9bxWNaYmGeqSEVkOve3OUuNR9AYALuVr5ahKMvSqhzN6SNgSIcL/9k/Id3af9BXGP+cNsE4T0BuNVJpaMxi1z/xCWkDQ/knHugieRPj6BO8Snqf1olOKDvwgm3834jdTX0WKWcIKIj0MkqbsVH3gD6v5aajseQbWrwpF2hofHkpR5YjJXCFViPxrJh3ymLomfnKfXiXqTaengJ2YCXpIcwtwDljuiECNO50k8g== 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 v1 08/15] crypto/cipher: Add setaad/gettag for AEAD modes Thread-Topic: [PATCH v1 08/15] crypto/cipher: Add setaad/gettag for AEAD modes Thread-Index: AQHdE2J4BDeYN29QKESbldEIhTDvKA== Date: Tue, 14 Jul 2026 07:29:13 +0000 Message-ID: <20260714072900.3023742-9-jamin_lin@aspeedtech.com> References: <20260714072900.3023742-1-jamin_lin@aspeedtech.com> In-Reply-To: <20260714072900.3023742-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_|SEZPR06MB6117:EE_ x-ms-office365-filtering-correlation-id: bb596b3a-b94e-413a-1be0-08dee1799aad x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|23010399003|7416014|376014|1800799024|921020|38070700021|6133799003|18002099003|22082099003|56012099006; x-microsoft-antispam-message-info: 48YxcA07Bhv/QZ7xJbAUYgorddaEA1NUKtXNwDeyTDVA6veKDn+pwy7NK5YG2JJGEKJA/ABsBzhh2OvXPfDJs0p7zY1twTZfVUrBHUxHXcEKlc/g8rHbVhLLt3QQG4/swPyAANmVU40Az4mlEKG1cWjwcYW7+AOQFEm+Xe9xjRTLF4KvgbzH91swfdPMpLxR2i8mChnqZLD/0d8LOLNvoc73yJXjSQkh6vLsRGwzYcQjefdEvWLpd7ODb8MIW+UlvyXJH+djqv1ywRXFtJs9OOisCJgHU7+z4tKIegVFzbouAEPQgFVdz7h1cyXhV8wjuZte4gNNLF/NALdxlveDaJRRDgchA7uK8HgDyoGNOM0vogfsJjmGJeW+4WpIhchCEkSCpN3uT4NWu7cJM+wQzO01rzI8doNhjNiL3qzEH8IbIuaWpCrOV/KBlzZw6OJHXtbTw7oE98YUcLDUIb73C9Ed9Z/FkBc0i5se59KZV54AI8FMdqtVyP4gYXCAqrtzlR4Ic1CoNrRshOxAYPAs6aiTGSPChTAj7vcVg3kDZXqGl01uZa7hrNC7PjxvHM5ufC+0cHLXk09kSdWaupWqa1VZyAKGNU+UgrQw2U0qJL+ILI7O3MISEsIe7t9dwMiWol3ABJaNo6e4Tqek4Lf6tDQEfigl9rsOkBvOW5yw+vi26tJ9vKX5lvDEdD+MevSjYIf3rRpmDgwGjUc45PkA3EEIhMD2a7eIjvNWPwcWfWKw3mjgsvQsbGBQRpTwzyIq 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)(366016)(23010399003)(7416014)(376014)(1800799024)(921020)(38070700021)(6133799003)(18002099003)(22082099003)(56012099006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?vojzuTIPN5F7AHREozkmu2spO275CEDrmNi9iBD7gFTErBQJVTWhg+Gdm+?= =?iso-8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?iso-8859-1?Q?T6iAsoCe7w=3D=3D?= Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: YfDp5s3Ftp0I9VRAVVwl1lQ4N+Rm51Kcu14YhxAyWacQ2pZt9RX3nnbDmhD4EE5rNxF+9ZnLn+9wfq7qSAWMDzUdiCwlzY6RjSwxom8ELnVNcOopwhzeDjemSk1Gj992m5oWTMSEVyqU4IFYUpwUE1s9LfwscDur2tVOG6Q77HX6RiEkura935Ol2sSSJssYloYRmiwpyA1XaneytdIugaYK1ej8XxJI9bYgQcrxB1ilotzmBShRvaEAljrYxMMzGuQQuriXQSfXVVFXGwDrbyFx4rkp3+dDqkiCAgVhNgIUigSFIZgq5R+ngww9tQAIg8I77Lf6JdGZFZ9v8PtSpg== 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: bb596b3a-b94e-413a-1be0-08dee1799aad X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2026 07:29:13.4432 (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: 2PV26vCzAyRBIUmxJ7HRLXBQg057q2HYl9LrjLZYWzX61Xg5RBj4voqZye5A/zuMWhO4CltFR5fmTm52dvnMHMpq/CR0W86Ipcn0ZpsdQik= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6117 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: 1784014217177158500 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 --- 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