@@ -200,34 +200,19 @@ pub enum PublicKey {
200200 Ed25519 ( Ed25519PublicKeyAsBytes ) ,
201201 Secp256k1 ( Secp256k1PublicKeyAsBytes ) ,
202202 Secp256r1 ( Secp256r1PublicKeyAsBytes ) ,
203- ZkLogin ( ZkLoginPublicIdentifier ) ,
203+ #[ deprecated( note = "zkLogin is deprecated and was never enabled on IOTA" ) ]
204+ ZkLoginDeprecated ,
204205 Passkey ( Secp256r1PublicKeyAsBytes ) ,
205206}
206207
207- /// A wrapper struct to retrofit in [enum PublicKey] for zkLogin.
208- /// Useful to construct [struct MultiSigPublicKey].
209- #[ derive( Clone , Debug , PartialEq , Eq , Serialize , Deserialize ) ]
210- pub struct ZkLoginPublicIdentifier ( pub Vec < u8 > ) ; // #[schemars(with = "Base64")]
211-
212- impl ZkLoginPublicIdentifier {
213- /// Consists of iss_bytes_len || iss_bytes || padded_32_byte_address_seed.
214- pub fn new ( iss : & str , address_seed : & Bn254FrElement ) -> IotaResult < Self > {
215- let mut bytes = Vec :: new ( ) ;
216- let iss_bytes = iss. as_bytes ( ) ;
217- bytes. extend ( [ iss_bytes. len ( ) as u8 ] ) ;
218- bytes. extend ( iss_bytes) ;
219- bytes. extend ( address_seed. padded ( ) ) ;
220-
221- Ok ( Self ( bytes) )
222- }
223- }
224208impl AsRef < [ u8 ] > for PublicKey {
225209 fn as_ref ( & self ) -> & [ u8 ] {
226210 match self {
227211 PublicKey :: Ed25519 ( pk) => & pk. 0 ,
228212 PublicKey :: Secp256k1 ( pk) => & pk. 0 ,
229213 PublicKey :: Secp256r1 ( pk) => & pk. 0 ,
230- PublicKey :: ZkLogin ( z) => & z. 0 ,
214+ #[ allow( deprecated) ]
215+ PublicKey :: ZkLoginDeprecated => & [ ] ,
231216 PublicKey :: Passkey ( pk) => & pk. 0 ,
232217 }
233218 }
@@ -306,7 +291,8 @@ impl PublicKey {
306291 PublicKey :: Ed25519 ( _) => SignatureScheme :: ED25519 , // Equals Ed25519IotaSignature::SCHEME
307292 PublicKey :: Secp256k1 ( _) => SignatureScheme :: Secp256k1 , // Equals Secp256k1IotaSignature::SCHEME
308293 PublicKey :: Secp256r1 ( _) => SignatureScheme :: Secp256r1 , // Equals Secp256r1IotaSignature::SCHEME
309- PublicKey :: ZkLogin ( _) => SignatureScheme :: ZkLoginAuthenticator ,
294+ #[ allow( deprecated) ]
295+ PublicKey :: ZkLoginDeprecated => SignatureScheme :: ZkLoginAuthenticatorDeprecated ,
310296 PublicKey :: Passkey ( _) => SignatureScheme :: PasskeyAuthenticator ,
311297 }
312298 }
@@ -621,7 +607,7 @@ impl<S: IotaSignatureInner + Sized> IotaSignature for S {
621607 & self ,
622608 value : & IntentMessage < T > ,
623609 author : IotaAddress ,
624- scheme : SignatureScheme ,
610+ _scheme : SignatureScheme ,
625611 ) -> Result < ( ) , IotaError >
626612 where
627613 T : Serialize ,
@@ -631,17 +617,11 @@ impl<S: IotaSignatureInner + Sized> IotaSignature for S {
631617 let digest = hasher. finalize ( ) . digest ;
632618
633619 let ( sig, pk) = & self . get_verification_inputs ( ) ?;
634- match scheme {
635- SignatureScheme :: ZkLoginAuthenticator => { } // Pass this check because zk login does
636- // not derive address from pubkey.
637- _ => {
638- let address = IotaAddress :: from ( pk) ;
639- if author != address {
640- return Err ( IotaError :: IncorrectSigner {
641- error : format ! ( "Incorrect signer, expected {author:?}, got {address:?}" ) ,
642- } ) ;
643- }
644- }
620+ let address = IotaAddress :: from ( pk) ;
621+ if author != address {
622+ return Err ( IotaError :: IncorrectSigner {
623+ error : format ! ( "Incorrect signer, expected {author:?}, got {address:?}" ) ,
624+ } ) ;
645625 }
646626
647627 pk. verify ( & digest, sig)
@@ -659,7 +639,8 @@ pub enum SignatureScheme {
659639 Secp256r1 ,
660640 BLS12381 , // This is currently not supported for user Iota Address.
661641 MultiSig ,
662- ZkLoginAuthenticator ,
642+ #[ deprecated( note = "zkLogin is deprecated and was never enabled on IOTA" ) ]
643+ ZkLoginAuthenticatorDeprecated ,
663644 PasskeyAuthenticator ,
664645 MoveAuthenticator ,
665646}
@@ -673,7 +654,8 @@ impl SignatureScheme {
673654 SignatureScheme :: MultiSig => 0x03 ,
674655 SignatureScheme :: BLS12381 => 0x04 , // This is currently not supported for user Iota
675656 // Address.
676- SignatureScheme :: ZkLoginAuthenticator => 0x05 ,
657+ #[ allow( deprecated) ]
658+ SignatureScheme :: ZkLoginAuthenticatorDeprecated => 0x05 ,
677659 SignatureScheme :: PasskeyAuthenticator => 0x06 ,
678660 SignatureScheme :: MoveAuthenticator => 0x07 ,
679661 }
@@ -702,7 +684,8 @@ impl SignatureScheme {
702684 0x02 => Ok ( SignatureScheme :: Secp256r1 ) ,
703685 0x03 => Ok ( SignatureScheme :: MultiSig ) ,
704686 0x04 => Ok ( SignatureScheme :: BLS12381 ) ,
705- 0x05 => Ok ( SignatureScheme :: ZkLoginAuthenticator ) ,
687+ #[ allow( deprecated) ]
688+ 0x05 => Ok ( SignatureScheme :: ZkLoginAuthenticatorDeprecated ) ,
706689 0x06 => Ok ( SignatureScheme :: PasskeyAuthenticator ) ,
707690 0x07 => Ok ( SignatureScheme :: MoveAuthenticator ) ,
708691 _ => Err ( IotaError :: KeyConversion ( "Invalid key scheme" . to_string ( ) ) ) ,
0 commit comments