pub struct KkParallelPacket {
pub chunks: Vec<KkAeadPacket>,
pub chunk_size: usize,
pub merkle_root: [u8; 32],
}Expand description
A parallel-encoded packet: large payload split into independently encrypted chunks, bound together by a Merkle commitment root.
Each chunk is a full KkAeadPacket with its own entropy snapshot
and temporal commitment. The Merkle root binds all chunk commitments
together so that no chunk can be reordered, removed, or replaced
without detection.
Fields§
§chunks: Vec<KkAeadPacket>The independently encrypted chunks, in order.
chunk_size: usizeThe chunk size used during encoding (needed to verify padding on last chunk).
merkle_root: [u8; 32]Merkle root: kk_hash(chunk_0.commitment || chunk_1.commitment || …)
Implementations§
Source§impl KkParallelPacket
impl KkParallelPacket
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Serialize the parallel packet for transmission.
Format:
[4-byte num_chunks][4-byte chunk_size][32-byte merkle_root]
for each chunk:
[4-byte chunk_bytes_len][chunk_bytes…]Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Deserialize a parallel packet from received bytes.
Trait Implementations§
Source§impl Clone for KkParallelPacket
impl Clone for KkParallelPacket
Source§fn clone(&self) -> KkParallelPacket
fn clone(&self) -> KkParallelPacket
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 moreAuto Trait Implementations§
impl Freeze for KkParallelPacket
impl RefUnwindSafe for KkParallelPacket
impl Send for KkParallelPacket
impl Sync for KkParallelPacket
impl Unpin for KkParallelPacket
impl UnsafeUnpin for KkParallelPacket
impl UnwindSafe for KkParallelPacket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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