Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3858395pxb; Mon, 8 Feb 2021 01:46:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcNse6p13uhhYQM0899iH1xJWAVaPMWRTjmryELWwYtemVcY0qhVBa7z3XoMSzmzmkvFar X-Received: by 2002:a05:6402:46:: with SMTP id f6mr16109863edu.163.1612777574826; Mon, 08 Feb 2021 01:46:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612777574; cv=none; d=google.com; s=arc-20160816; b=mBuO4EzIiR6RHH7MUkpp/TNwBMWdx66scSPQM4hqekIkAmFYvoUbNkFPCwPQylzITl 6ZzC9Brw/QAExzNeloq/FG5Ta/ZZUxAjUnk+fHrcmaPl7FPqEOi/AOOSofBIuyeJe/uk eueaUn0CisQoOoUg0OP6iReWLHxQx3CoOEBZsMQTCNO6d+Q51IFY3eZYVjAS4TlxwxyW eheC7qx7DgdTZNRlvOCbqC5d0Yy4qZvTNIkA0sel+Tmg9cCnV9Aicl7Q4HKZYjzgDH6q t1Gr3CXoLYMLo1FlPq38k/ec3x/9fkOiloLoH17AEcl+LTi04KZML7ncCJdnHwyU4Lxr h8yg== 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=IQoXP/3c9/S6TisSYehXEvruSf7VviF1D6HYp/U31TA=; b=i/ld2/VUTiwzL8bn954TxBhW/7kEAvutqBSvLxzcfYRMe/+K8rzRFGzyiNRGdEgG1D RjPu+ZsThEo6LNqXozmt8x8X7HiVGpAvcwqbuOSkeLQ+bLKlFamnNHXEvzzKLh5+Qpt5 DHZzl+sh2k/1z+VrVk+e5a4QG8eGQhZOe3SEQMAexKIPEUvSDr/T67CMqOcEVfFfy+aK +kn8KWZqkOyPQInDhXZbtta/4FlJ9ubeneSghONNbXQDvYKZ4uWa+hvg8lWCsmvLvYCy PmiY6Ggt/nie7/5ytGxumlCy0Sczbta+x83SulaZL5BZtnvfmysbb4GCkK7j2hMzazxz wcHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c17si11746193edr.88.2021.02.08.01.45.40; Mon, 08 Feb 2021 01:46:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbhBHJpL (ORCPT + 99 others); Mon, 8 Feb 2021 04:45:11 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11701 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbhBHJmN (ORCPT ); Mon, 8 Feb 2021 04:42:13 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DZ1Fn0v32zlDXl; Mon, 8 Feb 2021 17:39:41 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.498.0; Mon, 8 Feb 2021 17:41:19 +0800 From: Meng Yu To: , , , , , CC: , , , , Subject: [PATCH v8 0/9] add ECDH and CURVE25519 algorithms support for Kunpeng 930 Date: Mon, 8 Feb 2021 17:38:48 +0800 Message-ID: <1612777137-51067-1-git-send-email-yumeng18@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 1. Move curve ID from the key into the algorithm name (like 'ecdh-nist-pxxx' so we get its tfm like 'crypto_alloc_kpp("ecdh-nist-p256", 0, 0)'), in 'crypto/ecc.c' (has been verified by testmgr) and 'crypto/atmel-ecc.c' (only compiled, not do test), and modify 'testmgr.c' and 'net/bluetooth/smp.c' (only compiled, not do test) to adapt the modification; 2. Add new elliptic(nist-p224, nist-p384, nist-p521) curve parameters definitions, and reorder ECDH 'Curves IDs'; 3. Add new file 'include/crypto/ecc_curve.h', and move 'struct ecc_point' and 'struct ecc_curve' definitions to it, also add new APIs 'ecc_get_curveXXX' into it, with these APIs, users in kernel tree can get ECDH and curve25519 parameters; 4. Add ECDH and CURVE25519 algorithms support for Kunpeng 930. v7->v8: - patch #3 and #5: move the curve ID from the key into the algorithm name instead v6->v7: - patch #4: add function interface to expose elliptic curve parameters - patch #4: eliminate warning by 'kernel test robot' - patch #5: add function interface to expose curve25519 parameters v5->v6: - patch #1: add a new patch (the first patch), which is the "depend on" patch before v4->v5: - patch #4: delete P-128 and P-320 curve, as the few using case in the kernel v3 -> v4: - patch #3: add new, and move ecc_curve params to "include/crypto" v2 -> v3: - patch #5: fix sparse warnings - patch #5: add 'CRYPTO_LIB_CURVE25519_GENERIC' in 'Kconfig' v1 -> v2: - patch #5: delete `curve25519_null_point' Meng Yu (9): crypto: hisilicon/hpre - add version adapt to new algorithms crypto: hisilicon/hpre - add algorithm type crypto: atmel-ecc - move curve_id of ECDH from the key to algorithm name net/bluetooth: modify ECDH name in 'crypto_alloc_kpp' crypto: move curve_id of ECDH to algorithm name crypto: add new ecc curve and expose them crypto: hisilicon/hpre - add 'ECDH' algorithm crypto: add curve25519 params and expose them crypto: hisilicon/hpre - add 'CURVE25519' algorithm crypto/ecc.c | 17 +- crypto/ecc.h | 37 +- crypto/ecc_curve_defs.h | 124 +++ crypto/ecdh.c | 72 +- crypto/ecdh_helper.c | 4 +- crypto/testmgr.c | 11 +- crypto/testmgr.h | 32 +- drivers/crypto/atmel-ecc.c | 14 +- drivers/crypto/hisilicon/Kconfig | 1 + drivers/crypto/hisilicon/hpre/hpre.h | 17 +- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 1097 +++++++++++++++++++++++++-- drivers/crypto/hisilicon/hpre/hpre_main.c | 12 +- drivers/crypto/hisilicon/qm.c | 4 +- drivers/crypto/hisilicon/qm.h | 4 +- drivers/crypto/hisilicon/sec2/sec.h | 4 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 4 +- drivers/crypto/hisilicon/sec2/sec_crypto.h | 4 +- drivers/crypto/hisilicon/zip/zip.h | 4 +- drivers/crypto/hisilicon/zip/zip_crypto.c | 4 +- include/crypto/ecc_curve.h | 60 ++ include/crypto/ecdh.h | 7 +- net/bluetooth/ecdh_helper.c | 2 - net/bluetooth/selftest.c | 2 +- net/bluetooth/smp.c | 6 +- 24 files changed, 1370 insertions(+), 173 deletions(-) create mode 100644 include/crypto/ecc_curve.h -- 2.8.1