pub struct SURB<S: SphinxSuite, H: SphinxHeaderSpec> {
pub first_relayer: H::KeyId,
pub alpha: GenericArray<u8, <S::G as GroupElement<S::E>>::AlphaLen>,
pub header: RoutingInfo<H>,
pub sender_key: SecretKey16,
pub additional_data_receiver: H::SurbReceiverData,
}Expand description
Single Use Reply Block
This is delivered to the recipient, so they are able to send reply messages back anonymously (via the return path inside that SURB).
SURB is always created in a pair with ReplyOpener, so that the sending
party knows how to decrypt the data.
The SURB sent to the receiving party must be accompanied
by a Pseudonym, and once the receiving party uses that SURB to send a reply, it
must be accompanied by the same Pseudonym.
Upon receiving such a reply, the reply recipient (= sender of the SURB)
uses the Pseudonym to find the ReplyOpener created with the SURB to read the reply.
Always use create_surb to create the SURB and ReplyOpener pair.
Fields§
§first_relayer: H::KeyIdID of the first relayer.
alpha: GenericArray<u8, <S::G as GroupElement<S::E>>::AlphaLen>Alpha value for the header.
header: RoutingInfo<H>Sphinx routing header.
sender_key: SecretKey16Encryption key to use to encrypt the data for the SURB’s creator.
additional_data_receiver: H::SurbReceiverDataAdditional data for the SURB receiver.
Implementations§
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec> SURB<S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec> SURB<S, H>
Trait Implementations§
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec> Clone for SURB<S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec> Clone for SURB<S, H>
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec> Debug for SURB<S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec> Debug for SURB<S, H>
Source§impl<'de, S: SphinxSuite, H> Deserialize<'de> for SURB<S, H>where
H: Deserialize<'de> + SphinxHeaderSpec,
H::KeyId: Deserialize<'de>,
H::SurbReceiverData: Deserialize<'de>,
impl<'de, S: SphinxSuite, H> Deserialize<'de> for SURB<S, H>where
H: Deserialize<'de> + SphinxHeaderSpec,
H::KeyId: Deserialize<'de>,
H::SurbReceiverData: Deserialize<'de>,
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>,
Source§impl<S: SphinxSuite, H: SphinxHeaderSpec> PartialEq for SURB<S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec> PartialEq for SURB<S, H>
Source§impl<S: SphinxSuite, H> Serialize for SURB<S, H>
impl<S: SphinxSuite, H> Serialize for SURB<S, H>
Source§impl<'a, S: SphinxSuite, H: SphinxHeaderSpec> TryFrom<&'a [u8]> for SURB<S, H>
impl<'a, S: SphinxSuite, H: SphinxHeaderSpec> TryFrom<&'a [u8]> for SURB<S, H>
impl<S: SphinxSuite, H: SphinxHeaderSpec> Eq for SURB<S, H>
Auto Trait Implementations§
impl<S, H> Freeze for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: Freeze,
<H as SphinxHeaderSpec>::SurbReceiverData: Freeze,
<<<S as SphinxSuite>::G as GroupElement<<S as SphinxSuite>::E>>::AlphaLen as ArrayLength>::ArrayType<u8>: Freeze,
impl<S, H> RefUnwindSafe for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: RefUnwindSafe,
<H as SphinxHeaderSpec>::SurbReceiverData: RefUnwindSafe,
<<<S as SphinxSuite>::G as GroupElement<<S as SphinxSuite>::E>>::AlphaLen as ArrayLength>::ArrayType<u8>: RefUnwindSafe,
H: RefUnwindSafe,
impl<S, H> Send for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: Send,
<H as SphinxHeaderSpec>::SurbReceiverData: Send,
H: Send,
impl<S, H> Sync for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: Sync,
<H as SphinxHeaderSpec>::SurbReceiverData: Sync,
H: Sync,
impl<S, H> Unpin for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: Unpin,
<H as SphinxHeaderSpec>::SurbReceiverData: Unpin,
<<<S as SphinxSuite>::G as GroupElement<<S as SphinxSuite>::E>>::AlphaLen as ArrayLength>::ArrayType<u8>: Unpin,
H: Unpin,
impl<S, H> UnwindSafe for SURB<S, H>where
<H as SphinxHeaderSpec>::KeyId: UnwindSafe,
<H as SphinxHeaderSpec>::SurbReceiverData: UnwindSafe,
<<<S as SphinxSuite>::G as GroupElement<<S as SphinxSuite>::E>>::AlphaLen as ArrayLength>::ArrayType<u8>: UnwindSafe,
H: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more