pub struct DecapsulationKeyRejectNonContrib(pub(crate) DecapsulationKey);Expand description
X-Wing decapsulation key or private key.
This decapsulation key rejects “non-contributory behaviour” in the X25519 component of
X-Wing. To accept instead, use DecapsulationKey.
§Backstory
RFC 7748 defines the X25519 function, and specifies that when used for ECDH
(as it is inside X-Wing), the implementation MAY abort if the all-zero value
is produced as a shared secret. X-Wing, as initially specified, used the X25519
function without making any mention of this MAY, meaning that implementations
inherited whatever behaviour their underlying X25519 ECDH implementation provided.
This crate initially did not check for non-contributory behaviour, which meant it was incompatible with other implementations that did (in that it would accept ciphertexts that other implementations reject).
CFRG have decided that they will pick a single behaviour for the IETF X-Wing
standard. Until the corresponding RFC is published, this crate supports both
behaviours: constructing a DecapsulationKey accepts non-contributory behaviour for
backwards-compatibility with existing usages, and this struct can be used to instead
reject non-contributory behaviour. Once the RFC is published, DecapsulationKey will
be altered to match it.
Tuple Fields§
§0: DecapsulationKeyTrait Implementations§
Source§impl Clone for DecapsulationKeyRejectNonContrib
impl Clone for DecapsulationKeyRejectNonContrib
Source§fn clone(&self) -> DecapsulationKeyRejectNonContrib
fn clone(&self) -> DecapsulationKeyRejectNonContrib
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Decapsulator for DecapsulationKeyRejectNonContrib
impl Decapsulator for DecapsulationKeyRejectNonContrib
Source§fn encapsulation_key(&self) -> &EncapsulationKey
fn encapsulation_key(&self) -> &EncapsulationKey
Source§impl Generate for DecapsulationKeyRejectNonContrib
impl Generate for DecapsulationKeyRejectNonContrib
Source§fn try_generate_from_rng<R>(rng: &mut R) -> Result<Self, R::Error>where
R: TryCryptoRng + ?Sized,
fn try_generate_from_rng<R>(rng: &mut R) -> Result<Self, R::Error>where
R: TryCryptoRng + ?Sized,
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
CryptoRng.Source§impl KeyInit for DecapsulationKeyRejectNonContrib
impl KeyInit for DecapsulationKeyRejectNonContrib
Source§fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
fn new_from_slice(key: &[u8]) -> Result<Self, InvalidLength>
Source§impl TryDecapsulate for DecapsulationKeyRejectNonContrib
impl TryDecapsulate for DecapsulationKeyRejectNonContrib
Source§type Error = DecapsulationError
type Error = DecapsulationError
Source§fn try_decapsulate(&self, ct: &Ciphertext) -> Result<SharedKey, Self::Error>
fn try_decapsulate(&self, ct: &Ciphertext) -> Result<SharedKey, Self::Error>
Ciphertext a.k.a. “encapsulated key”.