[−][src]Struct ring::aead::LessSafeKey
Immutable keys for use in situations where OpeningKey
/SealingKey
and
NonceSequence
cannot reasonably be used.
These algorithms are NOT nonce-misuse-resistant. They use nonces small enough where the likelihood of collisions must be carefully considered.
Methods
impl<N> LessSafeKey<N> where
N: NonceGeneration,
[src]
N: NonceGeneration,
pub fn new(key: UnboundKey) -> Self
[src]
Constructs a LessSafeKey
from an UnboundKey
.
pub fn open_in_place<'in_out, A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8]
) -> Result<&'in_out mut [u8], Unspecified> where
A: AsRef<[u8]>,
[src]
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8]
) -> Result<&'in_out mut [u8], Unspecified> where
A: AsRef<[u8]>,
Like OpeningKey::open_in_place()
, except it accepts an arbitrary nonce.
nonce
must be unique for every use of the key to open data.
pub fn open_within<'in_out, A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8],
ciphertext_and_tag: RangeFrom<usize>
) -> Result<&'in_out mut [u8], Unspecified> where
A: AsRef<[u8]>,
[src]
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &'in_out mut [u8],
ciphertext_and_tag: RangeFrom<usize>
) -> Result<&'in_out mut [u8], Unspecified> where
A: AsRef<[u8]>,
Like OpeningKey::open_within()
, except it accepts an arbitrary nonce.
nonce
must be unique for every use of the key to open data.
pub fn algorithm(&self) -> &'static Algorithm
[src]
The key's AEAD algorithm.
impl LessSafeKey<ExplicitNonces>
[src]
pub fn seal_in_place<A, InOut>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut InOut
) -> Result<(), Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
[src]
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut InOut
) -> Result<(), Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
Renamed to seal_in_place_append_tag
.
Deprecated. Renamed to [seal_in_place_append_tag()
].
pub fn seal_in_place_append_tag<A, InOut>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut InOut
) -> Result<(), Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
[src]
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut InOut
) -> Result<(), Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
Like SealingKey::seal_in_place_append_tag()
, except it accepts an
arbitrary nonce.
nonce
must be unique for every use of the key to seal data.
pub fn seal_in_place_separate_tag<A>(
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut [u8]
) -> Result<Tag, Unspecified> where
A: AsRef<[u8]>,
[src]
&self,
nonce: Nonce,
aad: Aad<A>,
in_out: &mut [u8]
) -> Result<Tag, Unspecified> where
A: AsRef<[u8]>,
Like SealingKey::seal_in_place_separate_tag()
, except it accepts an
arbitrary nonce.
nonce
must be unique for every use of the key to seal data.
impl LessSafeKey<RandomNonces>
[src]
pub fn seal_with_random_nonce_in_place_append_tag<A, InOut>(
&self,
aad: Aad<A>,
in_out: &mut InOut,
rng: &dyn SecureRandom
) -> Result<Nonce, Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
[src]
&self,
aad: Aad<A>,
in_out: &mut InOut,
rng: &dyn SecureRandom
) -> Result<Nonce, Unspecified> where
A: AsRef<[u8]>,
InOut: AsMut<[u8]> + for<'in_out> Extend<&'in_out u8>,
Like SealingKey::seal_in_place_append_tag()
, except the nonce is
randomly generated.
The randomly-generated nonce is returned on success.
pub fn seal_with_random_nonce_in_place_separate_tag<A>(
&self,
aad: Aad<A>,
in_out: &mut [u8],
rng: &dyn SecureRandom
) -> Result<(Nonce, Tag), Unspecified> where
A: AsRef<[u8]>,
[src]
&self,
aad: Aad<A>,
in_out: &mut [u8],
rng: &dyn SecureRandom
) -> Result<(Nonce, Tag), Unspecified> where
A: AsRef<[u8]>,
Like SealingKey::seal_in_place_separate_tag()
, except the nonce is
randomly generated.
The randomly-generated nonce and the tag are returned on success.
Trait Implementations
impl<N> Debug for LessSafeKey<N> where
N: NonceGeneration,
[src]
N: NonceGeneration,
Auto Trait Implementations
impl<N> Unpin for LessSafeKey<N> where
N: Unpin,
N: Unpin,
impl<N> Sync for LessSafeKey<N> where
N: Sync,
N: Sync,
impl<N> Send for LessSafeKey<N> where
N: Send,
N: Send,
impl<N> UnwindSafe for LessSafeKey<N> where
N: UnwindSafe,
N: UnwindSafe,
impl<N> RefUnwindSafe for LessSafeKey<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,