|
iPXE
|
Go to the source code of this file.
Data Structures | |
| struct | elliptic_multiply_test |
| An elliptic curve point multiplication test. More... | |
| struct | elliptic_add_test |
| An elliptic curve point addition test. More... | |
Macros | |
| #define | BASE(...) |
| Define inline base point. | |
| #define | BASE_GENERATOR BASE() |
| Define base point to be curve's generator. | |
| #define | SCALAR(...) |
| Define inline scalar multiple. | |
| #define | ADDEND(...) |
| Define inline addend point. | |
| #define | AUGEND(...) |
| Define inline augend point. | |
| #define | EXPECTED(...) |
| Define inline expected result point. | |
| #define | EXPECTED_FAIL EXPECTED() |
| Define result as an expected failure. | |
| #define | ELLIPTIC_MULTIPLY_TEST(name, CURVE, BASE, SCALAR, EXPECTED) |
| Define an elliptic curve point multiplication test. | |
| #define | ELLIPTIC_ADD_TEST(name, CURVE, ADDEND, AUGEND, EXPECTED) |
| Define an elliptic curve point addition test. | |
| #define | elliptic_curve_ok(curve) |
| Report an elliptic curve sanity test result. | |
| #define | elliptic_multiply_ok(test) |
| Report an elliptic curve point multiplication test result. | |
| #define | elliptic_add_ok(test) |
| Report an elliptic curve point addition test result. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| void | elliptic_curve_okx (struct elliptic_curve *curve, const char *file, unsigned int line) |
| Report elliptic curve sanity test result. | |
| void | elliptic_multiply_okx (struct elliptic_multiply_test *test, const char *file, unsigned int line) |
| Report elliptic curve point multiplication test result. | |
| void | elliptic_add_okx (struct elliptic_add_test *test, const char *file, unsigned int line) |
| Report elliptic curve point addition test result. | |
| #define BASE | ( | ... | ) |
| #define BASE_GENERATOR BASE() |
Define base point to be curve's generator.
Definition at line 50 of file elliptic_test.h.
Referenced by ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), and ELLIPTIC_MULTIPLY_TEST().
| #define SCALAR | ( | ... | ) |
Define inline scalar multiple.
Definition at line 53 of file elliptic_test.h.
Referenced by ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), and X25519_KEY_TEST().
| #define ADDEND | ( | ... | ) |
Define inline addend point.
Definition at line 56 of file elliptic_test.h.
Referenced by ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), and ELLIPTIC_ADD_TEST().
| #define AUGEND | ( | ... | ) |
Define inline augend point.
Definition at line 59 of file elliptic_test.h.
Referenced by ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), and ELLIPTIC_ADD_TEST().
| #define EXPECTED | ( | ... | ) |
Define inline expected result point.
Definition at line 62 of file elliptic_test.h.
Referenced by ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_ADD_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), HMAC_TEST(), HMAC_TEST(), HMAC_TEST(), HMAC_TEST(), HMAC_TEST(), HMAC_TEST(), X25519_INVERT_TEST(), X25519_INVERT_TEST(), X25519_INVERT_TEST(), X25519_INVERT_TEST(), X25519_INVERT_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_KEY_TEST(), X25519_MULTIPLY_TEST(), X25519_MULTIPLY_TEST(), X25519_MULTIPLY_TEST(), X25519_MULTIPLY_TEST(), X25519_MULTIPLY_TEST(), X25519_MULTIPLY_TEST(), and X25519_MULTIPLY_TEST().
| #define EXPECTED_FAIL EXPECTED() |
Define result as an expected failure.
Definition at line 65 of file elliptic_test.h.
Referenced by ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), ELLIPTIC_MULTIPLY_TEST(), and ELLIPTIC_MULTIPLY_TEST().
Define an elliptic curve point multiplication test.
| name | Test name |
| CURVE | Elliptic curve |
| BASE | Base point |
| SCALAR | Scalar multiple |
| EXPECTED | Expected result point |
| test | Elliptic curve point multiplication test |
Definition at line 77 of file elliptic_test.h.
Define an elliptic curve point addition test.
| name | Test name |
| CURVE | Elliptic curve |
| ADDEND | Addend point |
| AUGEND | Augend point |
| EXPECTED | Expected result point |
| test | Elliptic curve point multiplication test |
Definition at line 101 of file elliptic_test.h.
| #define elliptic_curve_ok | ( | curve | ) |
Report an elliptic curve sanity test result.
| curve | Elliptic curve |
Definition at line 127 of file elliptic_test.h.
Referenced by p256_test_exec(), and p384_test_exec().
| #define elliptic_multiply_ok | ( | test | ) |
Report an elliptic curve point multiplication test result.
| test | Elliptic curve point multiplication test |
Definition at line 135 of file elliptic_test.h.
Referenced by p256_test_exec(), and p384_test_exec().
| #define elliptic_add_ok | ( | test | ) |
Report an elliptic curve point addition test result.
| test | Elliptic curve point addition test |
Definition at line 143 of file elliptic_test.h.
Referenced by p256_test_exec(), and p384_test_exec().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
extern |
Report elliptic curve sanity test result.
| curve | Elliptic curve |
| file | Test code file |
| line | Test code line |
Definition at line 50 of file elliptic_test.c.
References elliptic_curve::base, bigint_add, bigint_done, bigint_init, bigint_required_size, bigint_t, elliptic_is_infinity(), elliptic_multiply(), elliptic_curve::keysize, keysize, memcmp(), NULL, okx, elliptic_curve::order, and elliptic_curve::pointsize.
|
extern |
Report elliptic curve point multiplication test result.
| test | Elliptic curve point multiplication test |
| file | Test code file |
| line | Test code line |
Definition at line 93 of file elliptic_test.c.
References base, elliptic_curve::base, elliptic_multiply(), elliptic_curve::keysize, keysize, memcmp(), okx, elliptic_curve::pointsize, rc, and test.
|
extern |
Report elliptic curve point addition test result.
| test | Elliptic curve point addition test |
| file | Test code file |
| line | Test code line |
Definition at line 130 of file elliptic_test.c.
References elliptic_add(), memcmp(), okx, elliptic_curve::pointsize, rc, and test.