pub enum Suite {
ChaChaPoly,
AesGcm,
}Expand description
A Sendspin cipher suite: the <DH>_<cipher>_<hash> tail of a Noise protocol name.
The specification lists both of these and requires a server to have both; a client announces
the one it uses in client/init. Suite::ChaChaPoly is the default because it is the suite
this library has always spoken and the one its pairing wrapping was pinned against.
Variants§
ChaChaPoly
25519_ChaChaPoly_SHA256, the software-friendly suite and the default.
AesGcm
25519_AESGCM_SHA256, the hardware-accelerated suite.
Implementations§
Source§impl Suite
impl Suite
Sourcepub const ALL: [Suite; 2]
pub const ALL: [Suite; 2]
Every suite this implementation has, in the order the specification lists them.
Sourcepub const fn wire_name(self) -> &'static str
pub const fn wire_name(self) -> &'static str
The name client/init carries in suite, which is also the <DH>_<cipher>_<hash>
tail of the Noise protocol name.
Sourcepub const fn params(self) -> &'static str
pub const fn params(self) -> &'static str
The full Noise protocol name: Noise_KKpsk2_ followed by Suite::wire_name.
Sourcepub fn from_wire_name(name: &str) -> Option<Suite>
pub fn from_wire_name(name: &str) -> Option<Suite>
Parses the suite name a client/init announces.
None means this build does not have the suite. There is deliberately no fallback to
Suite::default: a caller that cannot honour the announced suite must refuse it.