Module: TTTLS13::NamedGroup
- Defined in:
- lib/tttls1.3/named_group.rb
Constant Summary collapse
- SECP256R1 =
"\x00\x17"- SECP384R1 =
"\x00\x18"- SECP521R1 =
"\x00\x19"- X25519 =
"\x00\x1d"- X448 =
"\x00\x1e"
Class Method Summary collapse
-
.curve_name(group) ⇒ String
SECG | ANSI X9.62 | NIST ————
---------------————- secp256r1 | prime256v1 | NIST P-256 secp384r1 | | NIST P-384 secp521r1 | | NIST P-521. -
.key_exchange_len(group) ⇒ Integer
For secp256r1, secp384r1, and secp521r1.
Class Method Details
.curve_name(group) ⇒ String
SECG | ANSI X9.62 | NIST ————---------------————- secp256r1 | prime256v1 | NIST P-256 secp384r1 | | NIST P-384 secp521r1 | | NIST P-521
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/tttls1.3/named_group.rb', line 74 def curve_name(group) case group when SECP256R1 'prime256v1' when SECP384R1 'secp384r1' when SECP521R1 'secp521r1' when X25519 'X25519' when X448 'X448' else # not supported other NamedGroup raise Error::ErrorAlerts, :internal_error end end |
.key_exchange_len(group) ⇒ Integer
For secp256r1, secp384r1, and secp521r1
struct {
uint8 legacy_form = 4;
opaque X[coordinate_length];
opaque Y[coordinate_length];
} UncompressedPointRepresentation;
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tttls1.3/named_group.rb', line 35 def key_exchange_len(group) case group when SECP256R1 65 when SECP384R1 97 when SECP521R1 133 when X25519 32 when X448 56 # not supported other NamedGroup # when FFDHE2048 # 256 # when FFDHE4096 # 512 # when FFDHE6144 # 768 # when FFDHE8192 # 1024 else raise Error::ErrorAlerts, :internal_error end end |