[crypto] Expose the base point as an explicit elliptic curve property

Add the generator base point as an explicit property of an elliptic
curve, and remove the ability to pass a NULL to elliptic_multiply() to
imply the use of the generator base point.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-12-05 13:00:12 +00:00
parent 88c3e68dfb
commit e50e30a7f8
6 changed files with 11 additions and 14 deletions

View File

@@ -181,9 +181,11 @@ struct elliptic_curve {
size_t pointsize;
/** Scalar (and private key) size */
size_t keysize;
/** Generator base point */
const void *base;
/** Multiply scalar by curve point
*
* @v base Base point (or NULL to use generator)
* @v base Base point
* @v scalar Scalar multiple
* @v result Result point to fill in
* @ret rc Return status code

View File

@@ -160,6 +160,7 @@ extern int weierstrass_multiply ( struct weierstrass_curve *curve,
.name = #_name, \
.pointsize = ( WEIERSTRASS_AXES * (_len) ), \
.keysize = (_len), \
.base = (_base), \
.multiply = _name ## _multiply, \
}