From nobody Sun Nov 24 12:55:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@seagate.com; 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=seagate.com); dmarc=pass(p=reject dis=none) header.from=seagate.com ARC-Seal: i=2; a=rsa-sha256; t=1723060554; cv=pass; d=zohomail.com; s=zohoarc; b=F6nVixD/OuhrE/hMJvI9LqHXwK9dMY+JD6t8ObY5KdzEMYbRxdZfIMwnF1/VjK7p4Kw5UNJpoKiw7/qCrnj0Y+2yiewe5UC7PBlxN9hoEr7gB9rf9mDl75FN/9RMU3vepg3pVZCocrCYiywI+wK18pGoEa0pnYWIOyBKEjrnjjc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723060554; 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=pu2PKmHBKNBvvAMDAMMjT7wALe9phLXftaB9PBEfcj4=; b=d6PUX4kLE5wXLRjIDkacZr8F7Q8uafhXF8KbQlb7FOPcQjhHfaYp/lwV5qApBoq2MOObAdN2++OI0Dkwk8nCiSFfwtItnLE59+neLypL6TmZJZnISaMXIfh04b01iWxKBHngcVmcOwqAm/pTt5dIUNAGVMHp6XWTXf69FMwTvJ4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=@seagate.com; 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=seagate.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1723060554672881.3093561229307; Wed, 7 Aug 2024 12:55:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbmk1-00087P-80; Wed, 07 Aug 2024 15:54:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbmjj-0006pb-Lx; Wed, 07 Aug 2024 15:54:20 -0400 Received: from esa.hc4959-67.iphmx.com ([139.138.35.140]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbmjg-00022d-Ua; Wed, 07 Aug 2024 15:54:19 -0400 Received: from mail-bn7nam10lp2042.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) ([104.47.70.42]) by ob1.hc4959-67.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 12:54:14 -0700 Received: from PH7PR13CA0018.namprd13.prod.outlook.com (2603:10b6:510:174::22) by SA0PR20MB3343.namprd20.prod.outlook.com (2603:10b6:806:98::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Wed, 7 Aug 2024 19:54:10 +0000 Received: from CY4PEPF0000EE3B.namprd03.prod.outlook.com (2603:10b6:510:174:cafe::10) by PH7PR13CA0018.outlook.office365.com (2603:10b6:510:174::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13 via Frontend Transport; Wed, 7 Aug 2024 19:54:10 +0000 Received: from sgspzesaa002.seagate.com (192.55.16.51) by CY4PEPF0000EE3B.mail.protection.outlook.com (10.167.242.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Wed, 7 Aug 2024 19:54:09 +0000 Received: from sgspiesaa002.seagate.com ([10.4.144.53]) by sgspzesaa002.seagate.com with ESMTP; 07 Aug 2024 12:54:00 -0700 Received: from unknown (HELO cortana..) ([10.4.50.14]) by sgspiesaa002.seagate.com with ESMTP; 07 Aug 2024 12:53:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=seagate.com; i=@seagate.com; q=dns/txt; s=stxiport; t=1723060456; x=1754596456; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RYDTlTtZKupLWxJ53d8EM5+2UmUIrTskgtcJ/stxq3c=; b=pLVagtDFoYEE4wtxoY3pPPL7/Vo19UwP/EJOMDsSCqqqiAsfnp6kDfyi 6qfAABx3DSxe9btOSfNMy3VU36vVkxfwwzKoDNJyKj6mlaFMtDXFnx2Vd li59AjDFoR/L6v40bUF7FebtR8S4HbcHEJaqG6ampPz450V+1PHaW9LB4 Y=; X-CSE-ConnectionGUID: GavfiKbORFqE58+9C5cyRg== X-CSE-MsgGUID: 8lgvRqiaQ7q4m6BEYk1Q3g== ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n1EctYI0FDpDyQznCWtjSOWZ2ifQclgBaMpgXCborw5J2njAm00IryZEUFp0XFTnZQbaKd2zYrwxLD8F9mvgw3DP8i4e7hovfii9TTyHdTRe4dzi0YJm2rSXg6oDC6BWk/ATwRMRkUocDt2EvO9ljTQ1awJEmv2V3Mc7SDe0G0gShAiIBqntdkAE6VU/lRYUGYA77qTCTrkkEgvaOgmHYhVKNgR6Rq4fkNKlfbZ349CxaArCVUzR/kkjm/GHhJn8YmYqliCC4sC/B/uPLcJj8FSny3emKmqkH2APGWR7d9ZVl8rPYUhWzWbxQeKvumb7joTGPUO7FsBgxJzr1sUadA== 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=pu2PKmHBKNBvvAMDAMMjT7wALe9phLXftaB9PBEfcj4=; b=gjnzg46YSEqIhhBwhUN3B/FWm4WdFYZMKbzGwAP2HtgrHw38PDufSwYyIPLvraqDEGgjc2Ob2XwlSt4OA0ynFglKOow6Xy62wWzC3+eWHdpl5tnLP5y5ALhJzvDNTVDaUlpvZcmKuAb8WsR20+mjC7vXYs7zqFMHANhpj6Mb+PQyApWLiXBuZ5xLeRtdsOmDBMBlf295CzI/1YFdaJyhtJxVikj69JNxec538jsphrvldWjREe1UyEZse5xJ6GVQyAQCSbKECE9JW3qixLMCpXnDb3o4KSteMPgKCSCGYygfNbVM1IPyI2veQLcMjLnnzeZGucMSuDz1Jq0cyYzf3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 192.55.16.51) smtp.rcpttodomain=nongnu.org smtp.mailfrom=seagate.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=seagate.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seagate.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pu2PKmHBKNBvvAMDAMMjT7wALe9phLXftaB9PBEfcj4=; b=Vl6blGzrkAnbtzuXlGXslzV36e9xyNcPMIMmgrfg0+fvbo8FuV8YVjTDu2AUFxyxZhjOLr3aHwkuu8VTt2sTPIExakUqQA1LiIof5wRLLsH1kpVIvGdwLuarthURqi1JPNBDC5XMj4LGVXFhunDUtUkk0sV2V/uCdiOJ+ncZ4Zk= X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 192.55.16.51) smtp.mailfrom=seagate.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=seagate.com; X-CSE-ConnectionGUID: iIln6l1ZRvOUUH/w/TGY5A== X-CSE-MsgGUID: Ll+BwVN2Q7uWB8LcViGMtg== X-CSE-ConnectionGUID: bsIny87pRxqmqGqRGmTlzg== X-CSE-MsgGUID: RFLrfgMHQJKRYUp3z1b1tg== X-IronPort-AV: E=Sophos;i="6.09,270,1716274800"; d="scan'208";a="122235489" STX-Internal-Mailhost: TRUE From: Alejandro Zeise To: qemu-arm@nongnu.org Cc: alejandro.zeise@seagate.com, kris.conklin@seagate.com, jonathan.henze@seagate.com, evan.burgess@seagate.com, clg@kaod.org, peter.maydell@linaro.org, berrange@redhat.com, qemu-devel@nongnu.org Subject: [PATCH v4 12/15] crypto/hash-nettle: Remove old hash API functions Date: Wed, 7 Aug 2024 19:51:19 +0000 Message-Id: <20240807195122.2827364-13-alejandro.zeise@seagate.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240807195122.2827364-1-alejandro.zeise@seagate.com> References: <20240807195122.2827364-1-alejandro.zeise@seagate.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3B:EE_|SA0PR20MB3343:EE_ X-MS-Office365-Filtering-Correlation-Id: f312d229-9ce8-4ef1-7b96-08dcb71ab481 STX-Hosted-IronPort-Oubound: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?NipDYk1yZZ8JdNiqE9pcEBBy55EzGSGOwxH6NmNfnj80bnQuGicFZVZEitTM?= =?us-ascii?Q?Y0yObXBRB1hEF3xefAtnGzvqn771dxZ7WWQEg0fRAvGpwSa5JGvwoit2FRwe?= =?us-ascii?Q?e5S51il+SoCoxMaBEOWXxf6XfIS3IL5Wv8EkCc7j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MxiTB84JuhU8dTH3uFAwsiQYai3sS0qQJfH5tgul936?= =?us-ascii?Q?J0XI+lM3xCYSEZw8BU55rP+iKwB3+MVLWXpAOEoqRjrnHVGF9rxaCxmTsUDi?= =?us-ascii?Q?wMy36nVKeHJFTIlhHaaLQiK0dZeOluHh2bjVNAOjl3C6ZlzL5JYeuOZ0xpGJ?= =?us-ascii?Q?3vjTbPSq71S75/hz0ZfiqoAcKE+Q+KNgbeZ6A/KW0slcQnTtha2JZ2NcrrNz?= =?us-ascii?Q?U7kMNF5Ssc9nMw4BbM1HrlMZFnpfvBwGiUVbB5hqAAUnrpLoP4g+Xq3Z9PoW?= =?us-ascii?Q?CLa05rM8KyDWhGF/xdtsch5E4h8Zx7w81LG0b4HKZE4csg5BEQM1MH+8bp/l?= =?us-ascii?Q?8XrZr1zP1t5l6IiA2h2YUIKxGbEKKP9P5+FA67OeIYkljK1Uz3r17gcSMmiS?= =?us-ascii?Q?0FWB7aEmd0/vGMfayc3ItffmSAn59INm?= X-Forefront-Antispam-Report: CIP:192.55.16.51; CTRY:SG; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sgspzesaa002.seagate.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: UQjQ4qMBah4yZVz0tKS24IyYN3FuzwwaLdQNJtmmprPP0fQN8TP1HSA985B8ZmQYucq6DFPwxFYUQ0NWpKo1HKlT94aoyesHrcID2xwwVtvsRP3vH2GD8lJtHsPnSBKtyX6/n3s19rtEfYWEDHY9YdSuN2ruZQADJee7Wd9iGdAO+RdBOmp3ybC+CsrAoY2zsnpP2saXM9/yDG4O3/Jhymgq5IB9Fxiz6Rd8eVIoB4QDfWlOXzgPLNc5a8fd/qLLaVSNRIA9v65kzIy/TYqNAnvzUFFxuDszuvmAa0ZlOkuv7cswRECVYBmO6W80/qT4SqTiA5YmfFFO26REfzo3/CZnzBiDXz3AgKpDVLXQHV1hj0bK+BlVshNOAOisnN5rnDzhNxf7WLrGYxMJIZr9AJMpdYNOgUztZZkecRHlrObBe5SefqS5MFe6+1ftMnA2wVzYDPlHBRvNow93Dg9TzDiIJPk530uifq04aTPg/szbKqQYbk6lki2X+sM0gX/q1JHBneTQ3waf9dQvWFMncLxYfvWQ+Z65beIZNtmYqfOvciXeK/pcA/CNq7m1X+QsbqknUS7V4j3BUEub2+nOAswRE04fH0u74LIIUrqzEhgn3Z8gL6V+X00DDRAVzwAM X-OriginatorOrg: seagate.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 19:54:09.7841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f312d229-9ce8-4ef1-7b96-08dcb71ab481 X-MS-Exchange-CrossTenant-Id: d466216a-c643-434a-9c2e-057448c17cbe X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d466216a-c643-434a-9c2e-057448c17cbe; Ip=[192.55.16.51]; Helo=[sgspzesaa002.seagate.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3B.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR20MB3343 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=lists.gnu.org; Received-SPF: pass client-ip=139.138.35.140; envelope-from=alejandro.zeise@seagate.com; helo=esa.hc4959-67.iphmx.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.144, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @seagate.com) X-ZM-MESSAGEID: 1723060555220116600 Content-Type: text/plain; charset="utf-8" Removes old hash implemention in the nettle hash driver. Signed-off-by: Alejandro Zeise Reviewed-by: Daniel P. Berrang=C3=A9 --- crypto/hash-nettle.c | 53 -------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/crypto/hash-nettle.c b/crypto/hash-nettle.c index 894c7b4fc3..bd489f865e 100644 --- a/crypto/hash-nettle.c +++ b/crypto/hash-nettle.c @@ -104,58 +104,6 @@ gboolean qcrypto_hash_supports(QCryptoHashAlgorithm al= g) return false; } =20 - -static int -qcrypto_nettle_hash_bytesv(QCryptoHashAlgorithm alg, - const struct iovec *iov, - size_t niov, - uint8_t **result, - size_t *resultlen, - Error **errp) -{ - size_t i; - union qcrypto_hash_ctx ctx; - - if (!qcrypto_hash_supports(alg)) { - error_setg(errp, - "Unknown hash algorithm %d", - alg); - return -1; - } - - qcrypto_hash_alg_map[alg].init(&ctx); - - for (i =3D 0; i < niov; i++) { - /* Some versions of nettle have functions - * declared with 'int' instead of 'size_t' - * so to be safe avoid writing more than - * UINT_MAX bytes at a time - */ - size_t len =3D iov[i].iov_len; - uint8_t *base =3D iov[i].iov_base; - while (len) { - size_t shortlen =3D MIN(len, UINT_MAX); - qcrypto_hash_alg_map[alg].write(&ctx, len, base); - len -=3D shortlen; - base +=3D len; - } - } - - if (*resultlen =3D=3D 0) { - *resultlen =3D qcrypto_hash_alg_map[alg].len; - *result =3D g_new0(uint8_t, *resultlen); - } else if (*resultlen !=3D qcrypto_hash_alg_map[alg].len) { - error_setg(errp, - "Result buffer size %zu is smaller than hash %zu", - *resultlen, qcrypto_hash_alg_map[alg].len); - return -1; - } - - qcrypto_hash_alg_map[alg].result(&ctx, *resultlen, *result); - - return 0; -} - static QCryptoHash *qcrypto_nettle_hash_new(QCryptoHashAlgorithm alg, Error **err= p) { @@ -230,7 +178,6 @@ int qcrypto_nettle_hash_finalize(QCryptoHash *hash, } =20 QCryptoHashDriver qcrypto_hash_lib_driver =3D { - .hash_bytesv =3D qcrypto_nettle_hash_bytesv, .hash_new =3D qcrypto_nettle_hash_new, .hash_update =3D qcrypto_nettle_hash_update, .hash_finalize =3D qcrypto_nettle_hash_finalize, --=20 2.34.1