pub struct CreateFastCell {
pub circ_id: u32,
pub key_material: [u8; 20],
pub unused: Vec<u8>,
}Expand description
Circuit creation cell using fast handshake (no public key).
CREATE_FAST cells are used to create circuits with the first hop (guard) relay. This is faster than the full CREATE handshake because the TLS connection already authenticates the relay.
§Security
CREATE_FAST does not provide forward secrecy because it doesn’t use public key cryptography. It relies on the TLS connection for security. For multi-hop circuits, subsequent hops should use CREATE2.
§Wire Format
[ CircID ][ 5 (CREATE_FAST) ][ Key Material (20 bytes) ][ Padding ]§Example
use stem_rs::client::cell::CreateFastCell;
// Create with random key material
let cell = CreateFastCell::new(1);Fields§
§circ_id: u32Circuit ID for the new circuit.
key_material: [u8; 20]Random key material (20 bytes) for key derivation.
unused: Vec<u8>Unused padding bytes.
Implementations§
Source§impl CreateFastCell
impl CreateFastCell
Sourcepub fn new(circ_id: u32) -> Self
pub fn new(circ_id: u32) -> Self
Creates a new CREATE_FAST cell with random key material.
§Arguments
circ_id- Circuit ID for the new circuit
Sourcepub fn with_key_material(circ_id: u32, key_material: [u8; 20]) -> Self
pub fn with_key_material(circ_id: u32, key_material: [u8; 20]) -> Self
Creates a CREATE_FAST cell with specific key material.
§Arguments
circ_id- Circuit ID for the new circuitkey_material- 20 bytes of key material
Trait Implementations§
Source§impl Clone for CreateFastCell
impl Clone for CreateFastCell
Source§fn clone(&self) -> CreateFastCell
fn clone(&self) -> CreateFastCell
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 CreateFastCell
impl Debug for CreateFastCell
Source§impl PartialEq for CreateFastCell
impl PartialEq for CreateFastCell
impl StructuralPartialEq for CreateFastCell
Auto Trait Implementations§
impl Freeze for CreateFastCell
impl RefUnwindSafe for CreateFastCell
impl Send for CreateFastCell
impl Sync for CreateFastCell
impl Unpin for CreateFastCell
impl UnwindSafe for CreateFastCell
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