mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
crypto: ecc - add curve25519 params and expose them
1. Add curve 25519 parameters in 'crypto/ecc_curve_defs.h'; 2. Add curve25519 interface 'ecc_get_curve25519_param' in 'include/crypto/ecc_curve.h', to make its parameters be exposed to everyone in kernel tree. Signed-off-by: Meng Yu <yumeng18@huawei.com> Reviewed-by: Zaibo Xu <xuzaibo@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -54,4 +54,21 @@ static struct ecc_curve nist_p256 = {
|
||||
.b = nist_p256_b
|
||||
};
|
||||
|
||||
/* curve25519 */
|
||||
static u64 curve25519_g_x[] = { 0x0000000000000009, 0x0000000000000000,
|
||||
0x0000000000000000, 0x0000000000000000 };
|
||||
static u64 curve25519_p[] = { 0xffffffffffffffed, 0xffffffffffffffff,
|
||||
0xffffffffffffffff, 0x7fffffffffffffff };
|
||||
static u64 curve25519_a[] = { 0x000000000001DB41, 0x0000000000000000,
|
||||
0x0000000000000000, 0x0000000000000000 };
|
||||
static const struct ecc_curve ecc_25519 = {
|
||||
.name = "curve25519",
|
||||
.g = {
|
||||
.x = curve25519_g_x,
|
||||
.ndigits = 4,
|
||||
},
|
||||
.p = curve25519_p,
|
||||
.a = curve25519_a,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user