Struct ring::aead::LessSafeKey
source · [−]pub struct LessSafeKey { /* private fields */ }
Expand description
Immutable keys for use in situations where OpeningKey
/SealingKey
and
NonceSequence
cannot reasonably be used.
Prefer to use OpeningKey
/SealingKey
and NonceSequence
when practical.
Implementations
sourceimpl LessSafeKey
impl LessSafeKey
sourcepub fn new(key: UnboundKey) -> Self
pub fn new(key: UnboundKey) -> Self
Constructs a LessSafeKey
from an UnboundKey
.
sourcepub 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]>,
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]>,
Like OpeningKey::open_in_place()
, except it accepts an arbitrary nonce.
nonce
must be unique for every use of the key to open data.
sourcepub 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]>,
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]>,
Like OpeningKey::open_within()
, except it accepts an arbitrary nonce.
nonce
must be unique for every use of the key to open data.
sourcepub 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>,
👎 Deprecated: Renamed to seal_in_place_append_tag
.
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>,
Renamed to seal_in_place_append_tag
.
Deprecated. Renamed to seal_in_place_append_tag()
.
sourcepub 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>,
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>,
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for LessSafeKey
impl Send for LessSafeKey
impl Sync for LessSafeKey
impl Unpin for LessSafeKey
impl UnwindSafe for LessSafeKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more