summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/weierstrass.h
Commit message (Collapse)AuthorAgeFilesLines
* [build] Mark known reviewed files as permitted for UEFI Secure BootMichael Brown2026-01-141-0/+1
| | | | | | | | | Some past security reviews carried out for UEFI Secure Boot signing submissions have covered specific drivers or functional areas of iPXE. Mark all of the files comprising these areas as permitted for UEFI Secure Boot. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow for an explicit representation of point at infinityMichael Brown2025-12-181-0/+8
| | | | | | | | | | | | | | | 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-0/+9
| | | | | | | | | | | | | | | 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-1/+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>
* [crypto] Expose the base point as an explicit elliptic curve propertyMichael Brown2025-12-051-0/+1
| | | | | | | | 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>
* [crypto] Add support for Weierstrass elliptic curve point multiplicationMichael Brown2025-01-281-0/+166
The NIST elliptic curves are Weierstrass curves and have the form y^2 = x^3 + ax + b with each curve defined by its field prime, the constants "a" and "b", and a generator base point. Implement a constant-time algorithm for point addition, based upon Algorithm 1 from "Complete addition formulas for prime order elliptic curves" (Joost Renes, Craig Costello, and Lejla Batina), and use this as a Montgomery ladder commutative operation to perform constant-time point multiplication. The code for point addition is implemented using a custom bytecode interpreter with 16-bit instructions, since this results in substantially smaller code than compiling the somewhat lengthy sequence of arithmetic operations directly. Values are calculated modulo small multiples of the field prime in order to allow for the use of relaxed Montgomery reduction. Signed-off-by: Michael Brown <mcb30@ipxe.org>