[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user