mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibCrypto+LibTLS: Generalize the elliptic curve interface
These changes generalize the interface with an elliptic curve implementation. This allows LibTLS to support elliptic curves generally without needing the specifics of elliptic curve implementations. This should allow for easier addition of other elliptic curves.
This commit is contained in:
parent
21bbff0349
commit
c1b041e761
10 changed files with 133 additions and 122 deletions
|
@ -197,23 +197,6 @@ enum class NamedCurve : u16 {
|
|||
x448 = 30,
|
||||
};
|
||||
|
||||
constexpr size_t named_curve_key_size(NamedCurve group)
|
||||
{
|
||||
switch (group) {
|
||||
case NamedCurve::secp256r1:
|
||||
case NamedCurve::secp384r1:
|
||||
case NamedCurve::secp521r1:
|
||||
// FIXME: Add the correct key size for these elliptic curves
|
||||
return 0;
|
||||
case NamedCurve::x25519:
|
||||
return 256;
|
||||
case NamedCurve::x448:
|
||||
return 448;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
enum class ECPointFormat : u8 {
|
||||
Uncompressed = 0,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue