pub trait SphinxHeaderSpec {
type KeyId: BytesRepresentable + Clone;
type Pseudonym: Pseudonym;
type RelayerData: BytesRepresentable;
type PacketReceiverData: BytesRepresentable;
type SurbReceiverData: BytesRepresentable;
type PRG: StreamCipher + StreamCipherSeek + KeyIvInit;
type UH: UniversalHash + KeyInit;
Show 9 associated constants and 2 methods
const MAX_HOPS: NonZeroUsize;
const RELAYER_DATA_SIZE: usize = <Self::RelayerData>::SIZE;
const SURB_RECEIVER_DATA_SIZE: usize = <Self::SurbReceiverData>::SIZE;
const RECEIVER_DATA_SIZE: usize = <Self::PacketReceiverData>::SIZE;
const KEY_ID_SIZE: NonZeroUsize = _;
const TAG_SIZE: usize = <<Self::UH as crypto_traits::BlockSizeUser>::BlockSize>::USIZE;
const ROUTING_INFO_LEN: usize = _;
const HEADER_LEN: usize = _;
const EXT_HEADER_LEN: usize = _;
// Provided methods
fn generate_filler(secrets: &[SharedSecret]) -> Result<Box<[u8]>> { ... }
fn new_prg(secret: &SecretKey) -> Result<Self::PRG> { ... }
}
Expand description
Contains the necessary size and type specifications for the Sphinx packet header.
Required Associated Constants§
Sourceconst MAX_HOPS: NonZeroUsize
const MAX_HOPS: NonZeroUsize
Maximum number of hops.
Provided Associated Constants§
Sourceconst RELAYER_DATA_SIZE: usize = <Self::RelayerData>::SIZE
const RELAYER_DATA_SIZE: usize = <Self::RelayerData>::SIZE
Size of the additional data for relayers.
Sourceconst SURB_RECEIVER_DATA_SIZE: usize = <Self::SurbReceiverData>::SIZE
const SURB_RECEIVER_DATA_SIZE: usize = <Self::SurbReceiverData>::SIZE
Size of the additional data included in SURBs.
Sourceconst RECEIVER_DATA_SIZE: usize = <Self::PacketReceiverData>::SIZE
const RECEIVER_DATA_SIZE: usize = <Self::PacketReceiverData>::SIZE
Size of the additional data for the packet receiver.
Sourceconst KEY_ID_SIZE: NonZeroUsize = _
const KEY_ID_SIZE: NonZeroUsize = _
Size of the public key identifier
Sourceconst TAG_SIZE: usize = <<Self::UH as crypto_traits::BlockSizeUser>::BlockSize>::USIZE
const TAG_SIZE: usize = <<Self::UH as crypto_traits::BlockSizeUser>::BlockSize>::USIZE
Size of the one-time authenticator tag.
Sourceconst ROUTING_INFO_LEN: usize = _
const ROUTING_INFO_LEN: usize = _
Length of the header routing information per hop.
The value shall not be overridden.
Sourceconst HEADER_LEN: usize = _
const HEADER_LEN: usize = _
Length of the whole Sphinx header.
The value shall not be overridden.
Sourceconst EXT_HEADER_LEN: usize = _
const EXT_HEADER_LEN: usize = _
Extended header size used for computations.
The value shall not be overridden.
Required Associated Types§
Sourcetype RelayerData: BytesRepresentable
type RelayerData: BytesRepresentable
Type representing additional data for relayers.
Sourcetype PacketReceiverData: BytesRepresentable
type PacketReceiverData: BytesRepresentable
Type representing additional data delivered to the packet receiver.
It is delivered on both forward and return paths.
Sourcetype SurbReceiverData: BytesRepresentable
type SurbReceiverData: BytesRepresentable
Type representing additional data delivered with each SURB to the packet receiver.
It is delivered only on the forward path.
Provided Methods§
fn generate_filler(secrets: &[SharedSecret]) -> Result<Box<[u8]>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.