crypto: hisilicon/hpre - Add processing of src_data in 'CURVE25519'
authorMeng Yu <yumeng18@huawei.com>
Sat, 27 Mar 2021 09:56:16 +0000 (17:56 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Apr 2021 07:28:14 +0000 (18:28 +1100)
commit0ae869926fab00b95709518d72cca2d50a29eccd
treef9fe4b9977053af3fffdd3239817248ad951a950
parent9bb3fbbff3710dfebeed2f8cf9ee61c415722543
crypto: hisilicon/hpre - Add processing of src_data in 'CURVE25519'

HPRE can only deal with src_data smaller than 'p' in 'CURVE25519'
algorithm, but 'rfc7748' says:
'Implementations MUST accept non-canonical values and process them as
if they had been reduced modulo the field prime'
So we get its modulus to p, and then deal it with HPRE.

Signed-off-by: Meng Yu <yumeng18@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/hpre/hpre_crypto.c