pub struct CapsuleFrag { /* private fields */ }Expand description
A reencrypted fragment of a Capsule created by a proxy.
Implementations§
Source§impl CapsuleFrag
impl CapsuleFrag
Sourcepub fn to_bytes_simple(&self) -> Box<[u8]>
pub fn to_bytes_simple(&self) -> Box<[u8]>
Serializes the capsule frag by concatenating the byte represenation of its constituents:
e1(compressed curve point, 33 bytes),v1(compressed curve point, 33 bytes),kfrag_id(32 bytes),precursor(compressed curve point, 33 bytes),e2(compressed curve point, 33 bytes),v2(compressed curve point, 33 bytes),u1, the kfrag PoK commitment (compressed curve point, 33 bytes),u2, the kfrag PoK (compressed curve point, 33 bytes),signature(big-endian scalar, 32 bytes),kfrag_signature(ECDSA signature serialized asrands, each a 32 byte big-endian scalar).
Sourcepub fn verify(
self,
capsule: &Capsule,
verifying_pk: &PublicKey,
delegating_pk: &PublicKey,
receiving_pk: &PublicKey,
) -> Result<VerifiedCapsuleFrag, (CapsuleFragVerificationError, Self)>
pub fn verify( self, capsule: &Capsule, verifying_pk: &PublicKey, delegating_pk: &PublicKey, receiving_pk: &PublicKey, ) -> Result<VerifiedCapsuleFrag, (CapsuleFragVerificationError, Self)>
Verifies the integrity of the capsule fragment, given the original capsule, the encrypting party’s key, the decrypting party’s key, and the signing key.
Sourcepub fn skip_verification(self) -> VerifiedCapsuleFrag
pub fn skip_verification(self) -> VerifiedCapsuleFrag
Explicitly skips CapsuleFrag::verify call.
Useful in cases when the verifying keys are impossible to obtain independently,
or when this capsule frag came from a trusted storage.
Warning: make sure you considered the implications of not enforcing verification.
Trait Implementations§
Source§impl Clone for CapsuleFrag
impl Clone for CapsuleFrag
Source§fn clone(&self) -> CapsuleFrag
fn clone(&self) -> CapsuleFrag
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CapsuleFrag
impl Debug for CapsuleFrag
Source§impl<'de> DefaultDeserialize<'de> for CapsuleFrag
Available on crate feature default-serialization only.
impl<'de> DefaultDeserialize<'de> for CapsuleFrag
Available on crate feature
default-serialization only.Source§impl DefaultSerialize for CapsuleFrag
Available on crate feature default-serialization only.
impl DefaultSerialize for CapsuleFrag
Available on crate feature
default-serialization only.Source§impl<'de> Deserialize<'de> for CapsuleFrag
impl<'de> Deserialize<'de> for CapsuleFrag
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CapsuleFrag
impl Display for CapsuleFrag
Source§impl PartialEq for CapsuleFrag
impl PartialEq for CapsuleFrag
Source§impl Serialize for CapsuleFrag
impl Serialize for CapsuleFrag
impl StructuralPartialEq for CapsuleFrag
Auto Trait Implementations§
impl Freeze for CapsuleFrag
impl RefUnwindSafe for CapsuleFrag
impl Send for CapsuleFrag
impl Sync for CapsuleFrag
impl Unpin for CapsuleFrag
impl UnwindSafe for CapsuleFrag
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