Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp14405583rwd; Sat, 24 Jun 2023 19:27:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4lvraPpHJRDOvOSIQB24jqRdHWX3Zsyiy10dd7WQeRghB4AlEW1eVQcs9d4keNWV1O0so2 X-Received: by 2002:a05:6a20:3d92:b0:117:2125:559d with SMTP id s18-20020a056a203d9200b001172125559dmr30377510pzi.4.1687660059933; Sat, 24 Jun 2023 19:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687660059; cv=none; d=google.com; s=arc-20160816; b=llk2DNHd+JDaIr36k4dmDuoQ5K0mBs3M7SwPlnCYh4nNbCfF/mwAJBdSWzU4yPcgJv p5NOwTmTewy9I5J9NJDXhPFcfe2VHqLv7aglJj0zUwAQ/6r9w1lfgLzEKaW1ITW9eFgg GR7FKPrSRA4Fm+o0CCKv28u9JXLStJ1X7+iZAERAA53QR0k92+y0H51udJ4Yy4PttIhh aWb2hZr1AmhA+lv3+9cV3vSIVR9M8miEpYU4LT3op3mZh54DyqZXJawGSNecdY0z1jvq o2UDq2GC9654pYq8TMPZJ6bhL0ieqbdQuklXpDqnPZ1P6YIBM/dqFywJQ9qTh5xNeVMz glhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=o0L/QAu0yHXjJ7ssMMSbwxDGLAelbjadzosD+Qxxo8s=; fh=QjZQlPJQOCj91Tsthr5xcEQGtCpM4kPHdPDxmrlgho4=; b=u8wxXCXIq5SnNxpJ6uiQCg9IuOw/arvNfN0yLfXEpXs0IwvNKbW6k+ogRkqWY0je5m mh3iPDDAxJA1qSZ7iNMtyArBVutbqqzh3fvnG6hvQrkmiFsmlZQ+IrDt53GeEQNpAuGL wmvANqzvA5IjW7tpOek2A6njBd/n7Q4JtNT4nK6vLub8Jv3TZrX9J7mdVu8DPanW57DY h7Kcjmc/pypD5STjBtmCdZ6dPjP9LNNM+fhqSGWYcHJ7xnKVI04a9cwzQiuCmiDwCQGQ kZTAIPTMlrlt18d3/H8qTSS/OoWe52jkIVlKRCZCOZSCgi/DMJ3dLu0NW7Ex5+NOVqyC /nGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020a63e413000000b00553a56f7b31si2597611pgi.330.2023.06.24.19.27.25; Sat, 24 Jun 2023 19:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230141AbjFYBuz (ORCPT + 99 others); Sat, 24 Jun 2023 21:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjFYBuz (ORCPT ); Sat, 24 Jun 2023 21:50:55 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0E2F10C9 for ; Sat, 24 Jun 2023 18:50:53 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4QpYpR74GTz1HBWd; Sun, 25 Jun 2023 09:50:39 +0800 (CST) Received: from huawei.com (10.67.175.31) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sun, 25 Jun 2023 09:50:51 +0800 From: GUO Zihua To: , CC: Subject: [PATCH RFC v3 0/3] crypto: Introduce SM9 key exchange Date: Sun, 25 Jun 2023 09:49:55 +0800 Message-ID: <20230625014958.32631-1-guozihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.31] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500024.china.huawei.com (7.185.36.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org ID-based key exchange algorithms provides the capability of using a human-readable ID as the public key and generate corresponding private key base on that ID. With a pre-defined pattern, the ID could be generated with openly known knowledge of the opponent, eliminating the need of a certificate and avoiding the whole verification chain. Instead of CAs, ID-based crypto algorithm relies on a KGC (Key Generation Center) for generating and distrubuting of private keys. Unlike CAs, KGC is not directly involved in any of the crypto procedures. SM9 is an ID-based crypto algorithm within the ShangMi family. The key exchange part of it was accepted in ISO/IEC 11770-3:2021. This patchset introduces key exchange capability of SM9. ID-based crypto algorithms are widely accepted as the next gen asymmetric cryptography for various fileds including telecommunication, emails, IoT etc.. You can find the technical details in the last two patch. v3: Fixed cocci warnings. v2: Added crypto/sm9.h which fixes build error. GUO Zihua (3): MPI: Export mpi_add_ui and mpi_mod for SM9 crypto: Introduce SM9 key exchange algorithm library crypto: Introduce SM9 key exchange algorithm crypto/Kconfig | 15 + crypto/Makefile | 4 + crypto/sm9.c | 914 ++++++++++++++++++++++++ crypto/sm9_lib.c | 1585 ++++++++++++++++++++++++++++++++++++++++++ crypto/sm9_lib.h | 92 +++ include/crypto/sm9.h | 84 +++ lib/mpi/mpi-add.c | 2 +- lib/mpi/mpi-mod.c | 1 + 8 files changed, 2696 insertions(+), 1 deletion(-) create mode 100644 crypto/sm9.c create mode 100644 crypto/sm9_lib.c create mode 100644 crypto/sm9_lib.h create mode 100644 include/crypto/sm9.h -- 2.17.1