pub struct SignedDiff {
pub encrypted_diff: EncryptedPayload,
pub signature: [u8; 64],
pub sender_public_key: [u8; 32],
pub sender_device_id: [u8; 16],
pub target_device_id: [u8; 16],
pub sequence: u64,
}Expand description
Signed diff wrapper for relay transmission
Per CP-013: Wraps an encrypted diff with authentication data for secure relay-based synchronization.
Fields§
§encrypted_diff: EncryptedPayloadThe encrypted diff payload
signature: [u8; 64]Ed25519 signature over: nonce || ciphertext || sender_id || target_id || sequence
sender_public_key: [u8; 32]Sender’s Ed25519 public key
sender_device_id: [u8; 16]Sender’s device ID (BLAKE3-16 of public key)
target_device_id: [u8; 16]Target device ID (for routing)
sequence: u64Sequence number for ordering
Implementations§
Source§impl SignedDiff
impl SignedDiff
Sourcepub fn new(
identity: &DeviceIdentity,
encrypted_diff: EncryptedPayload,
target_device_id: [u8; 16],
sequence: u64,
) -> Self
pub fn new( identity: &DeviceIdentity, encrypted_diff: EncryptedPayload, target_device_id: [u8; 16], sequence: u64, ) -> Self
Create a signed diff from an encrypted payload
Sourcepub fn sender_device_id_hex(&self) -> String
pub fn sender_device_id_hex(&self) -> String
Get sender device ID as hex string
Sourcepub fn target_device_id_hex(&self) -> String
pub fn target_device_id_hex(&self) -> String
Get target device ID as hex string
Trait Implementations§
Source§impl Clone for SignedDiff
impl Clone for SignedDiff
Source§fn clone(&self) -> SignedDiff
fn clone(&self) -> SignedDiff
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 SignedDiff
impl Debug for SignedDiff
Source§impl<'de> Deserialize<'de> for SignedDiff
impl<'de> Deserialize<'de> for SignedDiff
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
Auto Trait Implementations§
impl Freeze for SignedDiff
impl RefUnwindSafe for SignedDiff
impl Send for SignedDiff
impl Sync for SignedDiff
impl Unpin for SignedDiff
impl UnsafeUnpin for SignedDiff
impl UnwindSafe for SignedDiff
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