pub struct ZkLogin {Show 21 fields
pub sub: ByteVec,
pub aud: ByteVec,
pub iss: ByteVec,
pub salt: ByteVec,
pub zkaddr: [Wire; 4],
pub zkaddr_sha256: ByteVec,
pub jwt_claims_header: JwtClaims,
pub jwt_claims_payload: JwtClaims,
pub jwt_signature_verify: Rs256Verify,
pub base64_jwt_header: ByteVec,
pub base64_jwt_payload: ByteVec,
pub base64_jwt_signature: ByteVec,
pub jwt_header: ByteVec,
pub jwt_payload: ByteVec,
pub jwt_signature: ByteVec,
pub base64_jwt_payload_nonce: [Wire; 6],
pub nonce_sha256: ByteVec,
pub nonce: [Wire; 4],
pub vk_u: [Wire; 4],
pub t_max: ByteVec,
pub nonce_r: ByteVec,
}Expand description
A circuit that implements zk login.
Fields§
§sub: ByteVecThe sub claim value
aud: ByteVecThe aud claim value
iss: ByteVecThe iss claim value
salt: ByteVecThe salt value
zkaddr: [Wire; 4]The zkaddr (SHA256 hash of concat(sub, aud, iss, salt))
zkaddr_sha256: ByteVecThe message ByteVec whose SHA-256 is asserted to equal zkaddr
jwt_claims_header: JwtClaimsThe subcircuit that verifies the JWT header.
jwt_claims_payload: JwtClaimsThe subcircuit that verifies the JWT in the payload.
jwt_signature_verify: Rs256VerifyThe subcircuit that verifies the RS256 signature in the JWT.
base64_jwt_header: ByteVecThe JWT header
base64_jwt_payload: ByteVecThe JWT payload
base64_jwt_signature: ByteVecThe JWT signature
jwt_header: ByteVecThe decoded JWT header
jwt_payload: ByteVecThe decoded jwt_payload
jwt_signature: ByteVecThe decoded jwt_signature (264 bytes for Base64, little-endian packing)
base64_jwt_payload_nonce: [Wire; 6]The base64 encoded nonce
nonce_sha256: ByteVecThe message ByteVec whose SHA-256 is asserted to equal nonce
nonce: [Wire; 4]The nonce value (32 bytes SHA256 hash)
vk_u: [Wire; 4]The vk_u public key (32 bytes)
t_max: ByteVecThe t_max value
nonce_r: ByteVecThe nonce_r value
Implementations§
Source§impl ZkLogin
impl ZkLogin
pub fn new(b: &mut CircuitBuilder, config: &Config) -> Self
pub fn populate_sub(&self, w: &mut WitnessFiller<'_>, sub_bytes: &[u8])
pub fn populate_aud(&self, w: &mut WitnessFiller<'_>, aud_bytes: &[u8])
pub fn populate_iss(&self, w: &mut WitnessFiller<'_>, iss_bytes: &[u8])
pub fn populate_salt(&self, w: &mut WitnessFiller<'_>, salt_bytes: &[u8])
pub fn populate_zkaddr(&self, w: &mut WitnessFiller<'_>, zkaddr_hash: &[u8; 32])
pub fn populate_zkaddr_preimage( &self, w: &mut WitnessFiller<'_>, zkaddr_preimage: &[u8], )
pub fn populate_jwt_header( &self, w: &mut WitnessFiller<'_>, header_bytes: &[u8], )
pub fn populate_jwt_payload( &self, w: &mut WitnessFiller<'_>, payload_bytes: &[u8], )
pub fn populate_jwt_signature( &self, w: &mut WitnessFiller<'_>, signature_bytes: &[u8], )
pub fn populate_base64_jwt_header( &self, w: &mut WitnessFiller<'_>, bytes: &[u8], )
pub fn populate_base64_jwt_payload( &self, w: &mut WitnessFiller<'_>, bytes: &[u8], )
pub fn populate_base64_jwt_signature( &self, w: &mut WitnessFiller<'_>, bytes: &[u8], )
pub fn populate_rsa_modulus( &self, w: &mut WitnessFiller<'_>, modulus_bytes: &[u8], )
pub fn populate_jwt_header_attributes(&self, w: &mut WitnessFiller<'_>)
pub fn populate_nonce(&self, w: &mut WitnessFiller<'_>, nonce_hash: &[u8; 32])
pub fn populate_nonce_preimage( &self, w: &mut WitnessFiller<'_>, nonce_preimage: &[u8], )
pub fn populate_vk_u(&self, w: &mut WitnessFiller<'_>, vk_u_bytes: &[u8; 32])
pub fn populate_t_max(&self, w: &mut WitnessFiller<'_>, t_max_bytes: &[u8])
pub fn populate_nonce_r(&self, w: &mut WitnessFiller<'_>, nonce_r_bytes: &[u8])
pub fn populate_base64_jwt_payload_nonce( &self, w: &mut WitnessFiller<'_>, base64_nonce: &[u8], )
Auto Trait Implementations§
impl Freeze for ZkLogin
impl RefUnwindSafe for ZkLogin
impl Send for ZkLogin
impl Sync for ZkLogin
impl Unpin for ZkLogin
impl UnsafeUnpin for ZkLogin
impl UnwindSafe for ZkLogin
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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