Struct scrambledb::SerializedHPKE
source · pub struct SerializedHPKE { /* private fields */ }
Expand description
A wrapper type to facilitate (de-)serialization of HPKE ciphertexts to (and from) linear byte vectors.
Implementations§
source§impl SerializedHPKE
impl SerializedHPKE
sourcepub fn from_hpke_ct(ct: &HPKECiphertext) -> Self
pub fn from_hpke_ct(ct: &HPKECiphertext) -> Self
Prepare an HPKE ciphertext for serialization by wrapping it in
a SerializedHPKE
.
sourcepub fn to_hpke_ct(&self) -> HPKECiphertext
pub fn to_hpke_ct(&self) -> HPKECiphertext
Reconstruct an HPKE ciphertext from the wrapper type. This does not perform validation of the reconstructed ciphertext.
sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Deseralize a wrapped HPKE ciphertext from a byte vector. This does not perform validation of the deserialized ciphertext.
Auto Trait Implementations§
impl Freeze for SerializedHPKE
impl RefUnwindSafe for SerializedHPKE
impl Send for SerializedHPKE
impl Sync for SerializedHPKE
impl Unpin for SerializedHPKE
impl UnwindSafe for SerializedHPKE
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more