summaryrefslogtreecommitdiffstats
path: root/src/tests/p384_test.c
Commit message (Collapse)AuthorAgeFilesLines
* [crypto] Allow for an explicit representation of point at infinityMichael Brown2025-12-181-15/+62
| | | | | | | | | | | | | | | ECDSA requires the ability to add two arbitrary curve points, either of which may legitimately be the point at infinity. Update the API so that curves must choose an explicit affine representation for the point at infinity, and provide a method to test for this representation. Multiplication and addition will now allow this representation to be provided as an input, and will not fail if the result is the point at infinity. Callers must explicitly check for the point at infinity where needed (e.g. after computing the ECDHE shared secret curve point). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow for addition of arbitrary Weierstrass curve pointsMichael Brown2025-12-081-1/+112
| | | | | | | | | | | | | | | ECDSA verification requires the ability to add two arbitrary curve points (as well as the ability to multiply a curve point by a scalar). Add an elliptic curve method to perform arbitrary point addition. Pass in curve points as affine coordinates: this will require some redundant conversions between affine coorfinates and the internal representation as projective coordinates in Montgomery form, but keeps the API as simple as possible. Since we do not expect to perform a high volume of ECDSA signature verifications, these redundant calculations are an acceptable cost for keeping the code simple. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Expose the (prime) group order as an elliptic curve propertyMichael Brown2025-12-051-0/+3
| | | | | | | | | | | ECDSA requires knowledge of the group order of the base point, and is defined only for curves with a prime group order (e.g. the NIST curves). Add the group order as an explicit property of an elliptic curve, and add tests to verify that the order is correct. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Allow for elliptic curve tests other than multiplicationMichael Brown2025-12-051-154/+154
| | | | | | | Rename elliptic_ok() to elliptic_multiply_ok() etc, to create namespace for tests of other elliptic curve operations. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add definitions and tests for the NIST P-384 elliptic curveMichael Brown2025-01-301-0/+222
Signed-off-by: Michael Brown <mcb30@ipxe.org>