pub struct AvatarUploadCredentialRequest { /* private fields */ }Implementations§
Source§impl AvatarUploadCredentialRequest
impl AvatarUploadCredentialRequest
Sourcepub fn issue(
&self,
aci: Aci,
zk_credential_key_pub: &ZkCredentialPublicKey,
rotation_id: u64,
redemption_time: Timestamp,
params: &GenericServerSecretParams,
randomness: RandomnessBytes,
) -> Result<AvatarUploadCredentialResponse, ZkGroupVerificationFailure>
pub fn issue( &self, aci: Aci, zk_credential_key_pub: &ZkCredentialPublicKey, rotation_id: u64, redemption_time: Timestamp, params: &GenericServerSecretParams, randomness: RandomnessBytes, ) -> Result<AvatarUploadCredentialResponse, ZkGroupVerificationFailure>
Server-side: verify the Cm well-formedness proof and issue a blinded credential.
The server must authenticate the client to obtain aci, and must supply
zk_credential_key_pub from its record for that account. The Cm well-formedness proof
binds the blinded commitment to this zk_credential_key_pub, so passing the wrong
value will fail proof verification.
rotation_id is a server-chosen value that the client must already have folded into the
commitment Cm = [aci]*H1 + [zk_credential_key_secret]*H2 + [rotation_id]*H3. The server
supplies its own rotation_id here; the well-formedness proof is verified against it, so a
client that committed to a different value will fail issuance. The server never learns Cm
(it stays blinded) yet still controls the rotation ID.
Client-enforced invariant: The client must enforce that the server
only changes rotation_id when the client’s ZK credential key is
rotated. Otherwise a malicious server can fingerprint a client across
credential issuances by varying rotation_id while the client’s ACI and
ZK credential key are stable: the server can recompute
[delta_rotation_id]*H3 for any candidate (aci, zk_credential_key_pub) pair and check
whether the observed Cm-delta matches (of course it would have to test
all pairs because it wouldn’t know which ones had the same (aci,zk_credential_key_pub),
but finding a match would still be meaningful). With this invariant,
observing two distinct rotation IDs for the same account proves the ZK
credential key has rotated, which severs the linkability of pre- and
post-rotation avatar slots.
Trait Implementations§
Source§impl Clone for AvatarUploadCredentialRequest
impl Clone for AvatarUploadCredentialRequest
Source§fn clone(&self) -> AvatarUploadCredentialRequest
fn clone(&self) -> AvatarUploadCredentialRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for AvatarUploadCredentialRequest
impl<'de> Deserialize<'de> for AvatarUploadCredentialRequest
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>,
Source§impl PartialDefault for AvatarUploadCredentialRequest
impl PartialDefault for AvatarUploadCredentialRequest
Source§fn partial_default() -> Self
fn partial_default() -> Self
Auto Trait Implementations§
impl Freeze for AvatarUploadCredentialRequest
impl RefUnwindSafe for AvatarUploadCredentialRequest
impl Send for AvatarUploadCredentialRequest
impl Sync for AvatarUploadCredentialRequest
impl Unpin for AvatarUploadCredentialRequest
impl UnsafeUnpin for AvatarUploadCredentialRequest
impl UnwindSafe for AvatarUploadCredentialRequest
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
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