pub struct ClientKeyPair { /* private fields */ }Expand description
A participant’s per-round X25519 key pair.
The secret half never leaves the client. There is intentionally no
accessor for it and no Debug output that could print it: the whole point
of this type is that the aggregation server cannot obtain it.
Implementations§
Source§impl ClientKeyPair
impl ClientKeyPair
Sourcepub fn generate() -> Self
pub fn generate() -> Self
Generate a fresh key pair from operating-system entropy.
A new pair per round is what makes the masks of different rounds independent; reusing one across rounds would let a server that observes two rounds cancel the shared structure.
Sourcepub fn from_secret_bytes(bytes: [u8; 32]) -> Self
pub fn from_secret_bytes(bytes: [u8; 32]) -> Self
Build a key pair from explicit secret bytes.
Intended for reproducible protocol transcripts in tests and for
callers that already derive client secrets from their own key
hierarchy. Production clients should prefer Self::generate.
Sourcepub fn public_key(&self) -> ClientPublicKey
pub fn public_key(&self) -> ClientPublicKey
The public half, to be published to the aggregation server.
Derive the 32-byte seed shared with peer for round_seed.
Symmetric: a.shared_seed_with(b.public, r) == b.shared_seed_with(a.public, r).
Errors when peer is this client’s own key (a client has no pairwise
mask with itself) or when the Diffie-Hellman exchange yields the
all-zero shared secret, which is what a low-order (small-subgroup)
public key produces and would make the mask predictable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientKeyPair
impl RefUnwindSafe for ClientKeyPair
impl Send for ClientKeyPair
impl Sync for ClientKeyPair
impl Unpin for ClientKeyPair
impl UnsafeUnpin for ClientKeyPair
impl UnwindSafe for ClientKeyPair
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.