Skip to content

Commit

Permalink
Update signature scheme naming for ZK Login
Browse files Browse the repository at this point in the history
  • Loading branch information
kPatch committed Nov 6, 2024
1 parent 45c08bc commit e280cbf
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public enum SignatureScheme
Secp256k1,
Secp256r1,
MultiSig,
Zk
ZkLogin
}

/// <summary>
Expand Down Expand Up @@ -159,7 +159,7 @@ public static SuiResult<ParsedSignatureOutput> ParseSerializedSignature(string s
)
);

if (signature_scheme == SignatureScheme.Zk)
if (signature_scheme == SignatureScheme.ZkLogin)
return new SuiResult<ParsedSignatureOutput>
(
null,
Expand Down Expand Up @@ -209,7 +209,7 @@ public static class SignatureSchemeToFlag
{ SignatureScheme.Secp256k1, 0x01 },
{ SignatureScheme.Secp256r1, 0x02 },
{ SignatureScheme.MultiSig, 0x03 },
{ SignatureScheme.Zk, 0x05 }
{ SignatureScheme.ZkLogin, 0x05 }
};

/// <summary>
Expand Down Expand Up @@ -239,8 +239,8 @@ public static byte MultiSig
/// <summary>
/// Represents the flag for the zkLogin signature scheme.
/// </summary>
public static byte Zk
=> SignatureSchemeToFlag._signature_scheme_to_flag[SignatureScheme.Zk];
public static byte ZkLogin
=> SignatureSchemeToFlag._signature_scheme_to_flag[SignatureScheme.ZkLogin];

/// <summary>
/// Returns the byte flag that matches the signature scheme.
Expand All @@ -265,7 +265,7 @@ public static class SignatureSchemeToSize
{ SignatureScheme.Secp256k1, 33 },
{ SignatureScheme.Secp256r1, 33 },
{ SignatureScheme.MultiSig, 32 },
{ SignatureScheme.Zk, 32 }
{ SignatureScheme.ZkLogin, 32 }
};

/// <summary>
Expand Down Expand Up @@ -296,7 +296,7 @@ public static int MultiSig
/// Represents the size of the zkLogin signature in bytes.
/// </summary>
public static int Zk
=> SignatureSchemeToSize._signature_scheme_to_size[SignatureScheme.Zk];
=> SignatureSchemeToSize._signature_scheme_to_size[SignatureScheme.ZkLogin];

/// <summary>
/// Returns the size of signature based on particular signature scheme.
Expand All @@ -322,7 +322,7 @@ public static class SignatureFlagToScheme
{ 0x01, SignatureScheme.Secp256k1 },
{ 0x02, SignatureScheme.Secp256r1 },
{ 0x03, SignatureScheme.MultiSig },
{ 0x05, SignatureScheme.Zk }
{ 0x05, SignatureScheme.ZkLogin }
};

/// <summary>
Expand Down

0 comments on commit e280cbf

Please sign in to comment.