Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D2C2C4332F for ; Tue, 11 Jan 2022 17:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344523AbiAKRRc (ORCPT ); Tue, 11 Jan 2022 12:17:32 -0500 Received: from mail-mw2nam10on2078.outbound.protection.outlook.com ([40.107.94.78]:38384 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1344219AbiAKRQS (ORCPT ); Tue, 11 Jan 2022 12:16:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHkT3IGsQwpUuxfxaX3xJTt70jWLU4XgW73nB+xWdj1SanO6GR72iJzlLs2sMGEugCwJunzZqaiAVIdaPOzzKGJJgrCDr36jJAvQEojmh1Qh60/reCMvDZHmMONjkAzl0QmRwl38UmtTR7FNSgDjL0Mq++AVm+WEpxZbdb9+t/OXiuOe+/gT4TpXGHxhpTXrWIWlvYlYrUJLbz70k9pd3FR2RUzd/vAG2LQOQkGJAEnAkonKj6SWlEsOe/HMUdLnJreD1HW9udDcKRKhSnSzKzdQx83kIW1hdIH+HGFrTDiO7d2Fan2VWQBo4p9iIHilEaaeftWg4l3p1NMWFInHpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+q5yFVw1FvWVOxPW6sYuS3FQ744kmiWczGiDFWXd7G0=; b=WLFl+HFepSWSVJktk0Y/7SCzbIML25Hi5mjmEoEQhphY6aeXCpqxPJ/pKIj8qyNyoOTuIEvLPl6SGra7VhsyVtXWPcl8AQlb4O/J+zEpPhZ1+6NAtduAeRoHkRn+pqp0xaF6BKU8AlVpl/9IPQjmv+4nZBT5fj1xTu3OIxxGzGlqHTh3WUmMyaTlLjs5j1KJUok137mV5G1805WyTJY/7EFLs4F63vJ94a8v/25T6EKxtlsc/MGtHAeeHS3m/TCr7unXyMkfuiEaiyVHYmt2++aj4TmzzFcEoU1Uqcb+3svZb64kZ1A962pnKndmUdOLoTYp9QWWchCWIfcNXWh8rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+q5yFVw1FvWVOxPW6sYuS3FQ744kmiWczGiDFWXd7G0=; b=DZpj8pSWJ7cCN7YQsLhfSeU7Ta+fWfGxUM8mMZcPxdJhtrGSXWdZmctnFX/5Qy5XTXwjtEEZanmgPetPtFP/SbMOj6Npzs6ZwYfUzTXtsEv+otKWWq5o2R/t/KwsXlC2Nxhe/kLa/qqmR4/89iH5fpGmq5XFUgEUblnUv9XkZ8M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by PH0PR11MB5609.namprd11.prod.outlook.com (2603:10b6:510:e0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.9; Tue, 11 Jan 2022 17:15:22 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::d031:da9e:71a:73e4%6]) with mapi id 15.20.4867.012; Tue, 11 Jan 2022 17:15:22 +0000 From: Jerome Pouiller To: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "David S . Miller" , devicetree@vger.kernel.org, Rob Herring , linux-mmc@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Ulf Hansson , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [PATCH v9 14/24] wfx: add key.c/key.h Date: Tue, 11 Jan 2022 18:14:14 +0100 Message-Id: <20220111171424.862764-15-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> References: <20220111171424.862764-1-Jerome.Pouiller@silabs.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: SN1PR12CA0099.namprd12.prod.outlook.com (2603:10b6:802:21::34) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41342c22-ddfa-4a2e-ac1f-08d9d525f378 X-MS-TrafficTypeDiagnostic: PH0PR11MB5609:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qgiixNqVEDggbc77i324j3R9hTh0u4QZsnHKec/0pUcegtcL9kWyvTXjo/sH993UTjUbSlW5wJ3+uYDkpZ/+8SreClQbX+roC2QjnmYLX2GSaPYdfFw/Ofpk7N6aJBjMCsgIoIg97w30Uhk410TFJ7KxQ29gjpugD51MeUFvrydl2S0TnL7YddTpoCSntdTwgJj4+g3/1H6+dQjUX4EYWuKUCdMIqMi6SxeNaKfkdxKl4WFyyZoQ7rHh9a15bP8U/ebrTg9tz/xYhIXFb+71SALQ6cL/fYNrQ1PWmfoL1BK7kYKdIVAOrtjKspabY+yTsUgK05ITr55ZH+rmvgm3bNUHRejsw4jnF+UgJDJc+t6XdAJwrXjEBOxYexM7t/1jhNqIBmnSMqVJuJmKuySaAOH26nymG0w8vBy3CxrZ22wXFY6R2Mc1CRhxOTADJTPCGfKT6azJ7hMA1qCjWNcm0rS+KWEWD5sMrDLocgfvaBvla5A2dP03TpPBJW5URsPaooUTDIkYMJlafy1eSePJafKWjIpGGl4CCHqCWO3/CjApJW3X44F8FPqeGvvsQyZ3FxjiM3Pd6Xekkl27n4DAC4+3E+/8kaU7uOqgooAdM/42tcolYAxg4mbMdr/rM0rWQIjyLZkrXPMW/hHTiPKF4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5657.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(5660300002)(8676002)(36756003)(38100700002)(186003)(7416002)(66476007)(54906003)(6486002)(6916009)(6512007)(4326008)(508600001)(107886003)(66946007)(6666004)(2616005)(1076003)(8936002)(66556008)(86362001)(2906002)(6506007)(52116002)(66574015)(316002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ckJhazA1R3ZpUk0zQjNrdXNIRFN3K1NMd1o3SXZSV0NtZFVhdkR5WkRKTTho?= =?utf-8?B?ZHB2SVJJRzdRb2FPSm5OcHBvOVUrU21wanR3R2xZdGcrZWxwRWdob241aDdO?= =?utf-8?B?bHJ1RnhjYnI3OVV3REtSSjJZbm5MY3BCMnVhSW4zZVlaMkQ5Y01rNS95cU5T?= =?utf-8?B?ZDZybVc0a2ZrZTRKUExkVTQ0Qm5pQkVjbktHcWJLYjJrM3hEZ1hvb3dieE40?= =?utf-8?B?cG1OL081S0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Iza0pMTmt3MndkbStCS211NTQ5TVhES1VBRHQ2?= =?utf-8?B?aG9ESnZJclc3dm16aEkyOXpyVmJDVjhYVU9pc1hhZitwSGxmWGFreDlIVWRn?= =?utf-8?B?d3hROHZaRDdhYjF4MG5lbHYyZ2M0b1pJaHlxQis4eU9tcURVWDZaMjFTZnVP?= =?utf-8?B?TzF4aytya2MxYXIwMGsxZHhBUm5HblBOQ1llVVMwZEdpbHBIdmdkVStPU3hY?= =?utf-8?Q?PP6gYwzrH6vn0tcdxRJy3u8p2Aon7FThjnvrSWjF1c=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 41342c22-ddfa-4a2e-ac1f-08d9d525f378 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2022 17:15:22.6958 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KHqtHlSxS68Qhr0TfCrKhzs19DQ2YF5FgCQyR51fuda0PVFOhkzZYlDJtFZirVL1HLyf+151V2NnKMwa6H/0mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5609 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogSsOpcsO0bWUgUG91aWxsZXIgPGplcm9tZS5wb3VpbGxlckBzaWxhYnMuY29tPgoKU2ln bmVkLW9mZi1ieTogSsOpcsO0bWUgUG91aWxsZXIgPGplcm9tZS5wb3VpbGxlckBzaWxhYnMuY29t PgotLS0KIGRyaXZlcnMvbmV0L3dpcmVsZXNzL3NpbGFicy93Zngva2V5LmMgfCAyMjcgKysrKysr KysrKysrKysrKysrKysrKysrKysKIGRyaXZlcnMv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5rZXlfaWQg PSBrZXktPmtleWlkeDsKKwltc2ctPmtleV9sZW5ndGggPSBrZXktPmtleWxlbjsKKwltZW1jcHko bXNnLT5rZXlfZGF0YSwga2V5LT5rZXksIGtleS0+a2V5bGVuKTsKKwlyZXR1cm4gSElGX0tFWV9U WVBFX1dFUF9ERUZBVUxUOworfQorCitzdGF0aWMgdTggZmlsbF90a2lwX3BhaXIoc3RydWN0IHdm eF9oaWZfdGtpcF9wYWlyd2lzZV9rZXkgKm1zZywKKwkJCSBzdHJ1Y3QgaWVlZTgwMjExX2tleV9j b25mICprZXksIHU4ICpwZWVyX2FkZHIpCit7CisJdTggKmtleWJ1ZiA9IGtleS0+a2V5OworCisJ V0FSTihrZXktPmtleWxlbiAhPSBzaXplb2YobXNnLT50a2lwX2tleV9kYXRhKSArIHNpemVvZiht c2ctPnR4X21pY19rZXkpICsKKwkJCSAgICBzaXplb2YobXNnLT5yeF9taWNfa2V5KSwgImluY29u c2lzdGVudCBkYXRhIik7CisJbWVtY3B5KG1zZy0+dGtpcF9rZXlfZGF0YSwga2V5YnVmLCBzaXpl b2YobXNnLT50a2lwX2tleV9kYXRhKSk7CisJa2V5YnVmICs9IHNpemVvZihtc2ctPnRraXBfa2V5 X2RhdGEpOworCW1lbWNweShtc2ctPnR4X21pY19rZXksIGtleWJ1Ziwgc2l6ZW9mKG1zZy0+dHhf bWljX2tleSkpOworCWtleWJ1ZiArPSBzaXplb2YobXNnLT50eF9taWNfa2V5KTsKKwltZW1jcHko bXNnLT5yeF9taWNfa2V5LCBrZXlidWYsIHNpemVvZihtc2ctPnJ4X21pY19rZXkpKTsKKwlldGhl cl9hZGRyX2NvcHkobXNnLT5wZWVyX2FkZHJlc3MsIHBlZXJfYWRkcik7CisJcmV0dXJuIEhJRl9L RVlfVFlQRV9US0lQX1BBSVJXSVNFOworfQorCitzdGF0aWMgdTggZmlsbF90a2lwX2dyb3VwKHN0 cnVjdCB3ZnhfaGlmX3RraXBfZ3JvdXBfa2V5ICptc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