[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
+3 -2
View File
@@ -52,6 +52,7 @@ void elliptic_okx ( struct elliptic_test *test, const char *file,
size_t pointsize = curve->pointsize;
size_t keysize = curve->keysize;
uint8_t actual[pointsize];
const void *base;
int rc;
/* Sanity checks */
@@ -62,8 +63,8 @@ void elliptic_okx ( struct elliptic_test *test, const char *file,
file, line );
/* Perform point multiplication */
rc = elliptic_multiply ( curve, ( test->base_len ? test->base : NULL ),
test->scalar, actual );
base = ( test->base_len ? test->base : curve->base );
rc = elliptic_multiply ( curve, base, test->scalar, actual );
if ( test->expected_len ) {
okx ( rc == 0, file, line );
} else {