pub struct ReplicaSecretPayload {
pub secret: Option<Secret>,
pub shares: Vec<ChannelShare>,
pub shared_key: Vec<u8>,
}Expand description
The composite payload sent to each Replica Destination on a
ProtectSecret round. Carries the full Secret plus the map of
(channel_id → committed_share) for the same round, so the
Destination can recover via either path — read the secret directly,
or contact each helper using secret.helpers[i].shared_key and
request their stored share.
§Group-key handover
All replica channels for a given secret_id converge on a single
symmetric “group” key. The shared_key field carries that group key
inside the encrypted payload only when the sender knows the
receiver doesn’t have it yet — i.e. on the first round to a newly
paired Destination. Both sides swap their stored channel key
((secret_id, channel_id) in crate::protocol::DeRecSecretStore)
from the per-pair ephemeral handshake key to the group key:
- Sender: swap immediately after the request envelope is sent. The ack response from the new joiner will already be encrypted with the group key.
- Receiver: swap before encrypting the ack response, so the ack uses the group key and matches what the sender expects.
On the first-ever replica pair, the group key is implicitly the
pair-handshake key — shared_key is left empty, no swap happens,
and the channel-key entry both sides already saved is the group key.
Fields§
§secret: Option<Secret>The full secret the sender is committing to this version.
One entry per helper that received a VSS share on this round.
32-byte replica-group key. Present only on the first-sync round
to a newly-paired Destination; empty on every subsequent round
(since the receiving channel already holds the group key) and
empty when the receiving Destination is the very first pair for
this secret_id (the pair-handshake key is implicitly the group
key). See type-level docs for the swap protocol.
Trait Implementations§
Source§impl Clone for ReplicaSecretPayload
impl Clone for ReplicaSecretPayload
Source§fn clone(&self) -> ReplicaSecretPayload
fn clone(&self) -> ReplicaSecretPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplicaSecretPayload
impl Debug for ReplicaSecretPayload
Source§impl Default for ReplicaSecretPayload
impl Default for ReplicaSecretPayload
Source§impl Message for ReplicaSecretPayload
impl Message for ReplicaSecretPayload
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ReplicaSecretPayload
impl PartialEq for ReplicaSecretPayload
impl StructuralPartialEq for ReplicaSecretPayload
Auto Trait Implementations§
impl Freeze for ReplicaSecretPayload
impl RefUnwindSafe for ReplicaSecretPayload
impl Send for ReplicaSecretPayload
impl Sync for ReplicaSecretPayload
impl Unpin for ReplicaSecretPayload
impl UnsafeUnpin for ReplicaSecretPayload
impl UnwindSafe for ReplicaSecretPayload
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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