1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (c) 2021 HiSilicon */
4 #ifndef _CRYTO_ECC_CURVE_H
5 #define _CRYTO_ECC_CURVE_H
7 #include <linux/types.h>
10 * struct ecc_point - elliptic curve point in affine coordinates
12 * @x: X coordinate in vli form.
13 * @y: Y coordinate in vli form.
14 * @ndigits: Length of vlis in u64 qwords.
23 * struct ecc_curve - definition of elliptic curve
25 * @name: Short name of the curve.
26 * @g: Generator point of the curve.
27 * @p: Prime number, if Barrett's reduction is used for this curve
28 * pre-calculated value 'mu' is appended to the @p after ndigits.
29 * Use of Barrett's reduction is heuristically determined in
31 * @n: Order of the curve group.
32 * @a: Curve parameter a.
33 * @b: Curve parameter b.
45 * ecc_get_curve() - get elliptic curve;
46 * @curve_id: Curves IDs:
47 * defined in 'include/crypto/ecdh.h';
49 * Returns curve if get curve succssful, NULL otherwise
51 const struct ecc_curve *ecc_get_curve(unsigned int curve_id);
54 * ecc_get_curve25519() - get curve25519 curve;
58 const struct ecc_curve *ecc_get_curve25519(void);