aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/crypto.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2025-01-21 15:29:05 +0000
committerMichael Brown <mcb30@ipxe.org>2025-01-21 15:55:33 +0000
commitc9291bc5c7adfa9aa05e94aded90ba49d3dc8179 (patch)
treef81108322d7289bf6d653e11d75eb6b58348dde2 /src/include/ipxe/crypto.h
parentdf7ec31766cd08eb1e01d59afc79198f5411517e (diff)
downloadipxe-c9291bc5c7adfa9aa05e94aded90ba49d3dc8179.tar.gz
[tls] Allow for NIST elliptic curve point formats
The elliptic curve point representation for the x25519 curve includes only the X value, since the curve is designed such that the Montgomery ladder does not need to ever know or calculate a Y value. There is no curve point format byte: the public key data is simply the X value. The pre-master secret is also simply the X value of the shared secret curve point. The point representation for the NIST curves includes both X and Y values, and a single curve point format byte that must indicate that the format is uncompressed. The pre-master secret for the NIST curves does not include both X and Y values: only the X value is used. Extend the definition of an elliptic curve to allow the point size to be specified separately from the key size, and extend the definition of a TLS named curve to include an optional curve point format byte and a pre-master secret length. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/crypto.h')
-rw-r--r--src/include/ipxe/crypto.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/include/ipxe/crypto.h b/src/include/ipxe/crypto.h
index dcc73f3ef..4bd543ae2 100644
--- a/src/include/ipxe/crypto.h
+++ b/src/include/ipxe/crypto.h
@@ -184,7 +184,9 @@ struct pubkey_algorithm {
struct elliptic_curve {
/** Curve name */
const char *name;
- /** Key size */
+ /** Point (and public key) size */
+ size_t pointsize;
+ /** Scalar (and private key) size */
size_t keysize;
/** Multiply scalar by curve point
*