Bases: CipherSuiteBase
TLS 1.3 record protection algorithms.
suite_id
Source code in swarmauri_cipher_suite_tls13/Tls13CipherSuite.py
| def suite_id(self) -> str:
return "tls13"
|
supports
Source code in swarmauri_cipher_suite_tls13/Tls13CipherSuite.py
| def supports(self) -> Mapping[CipherOp, Iterable[Alg]]:
return {
"encrypt": _TLS13,
"decrypt": _TLS13,
}
|
default_alg
default_alg(op, *, for_key=None)
Source code in swarmauri_cipher_suite_tls13/Tls13CipherSuite.py
| def default_alg(self, op: CipherOp, *, for_key: Optional[KeyRef] = None) -> Alg:
return "TLS_AES_256_GCM_SHA384"
|
features
Source code in swarmauri_cipher_suite_tls13/Tls13CipherSuite.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52 | def features(self) -> Features:
return {
"suite": "tls13",
"version": 1,
"dialects": {"tls": list(_TLS13)},
"ops": {
"encrypt": {
"default": self.default_alg("encrypt"),
"allowed": list(_TLS13),
}
},
"constraints": {"record_max": 16384, "aead": {"tagBits": 128}},
"compliance": {"fips": False},
}
|
normalize
normalize(
*, op, alg=None, key=None, params=None, dialect=None
)
Source code in swarmauri_cipher_suite_tls13/Tls13CipherSuite.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 | def normalize(
self,
*,
op: CipherOp,
alg: Optional[Alg] = None,
key: Optional[KeyRef] = None,
params: Optional[ParamMapping] = None,
dialect: Optional[str] = None,
) -> NormalizedDescriptor:
allowed = set(self.supports().get(op, ()))
chosen = alg or self.default_alg(op)
if chosen not in allowed:
raise ValueError(f"{chosen=} not supported for {op=} in TLS1.3")
resolved = dict(params or {})
return {
"op": op,
"alg": chosen,
"dialect": "tls" if dialect is None else dialect,
"mapped": {"tls": chosen, "provider": chosen},
"params": resolved,
"constraints": {"record_max": 16384, "tagBits": 128},
"policy": self.policy(),
}
|