mirror of
https://github.com/ipxe/ipxe
synced 2026-01-22 03:32:59 +03:00
[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:
@@ -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
|
||||
|
||||
@@ -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, \
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user