diff --git a/um_crypto/kuwo/src/lib.rs b/um_crypto/kuwo/src/lib.rs index 1136243..1df2933 100644 --- a/um_crypto/kuwo/src/lib.rs +++ b/um_crypto/kuwo/src/lib.rs @@ -112,7 +112,7 @@ impl Header { let cipher = match self.version { 1 => Cipher::V1(CipherV1::new(self.resource_id)), 2 => match ekey { - Some(ekey) => Cipher::V2(CipherV2::new(ekey)?), + Some(ekey) => Cipher::V2(CipherV2::new_from_ekey(ekey)?), None => Err(KuwoCryptoError::V2EKeyRequired)?, }, version => Err(KuwoCryptoError::UnsupportedVersion(version as usize))?, @@ -134,9 +134,9 @@ impl Header { pub struct CipherBoDian(QMCv2Cipher); impl CipherBoDian { - pub fn new(ekey: &str) -> Result { + pub fn new>(ekey: T) -> Result { let ekey = des::decode_ekey(&ekey, &SECRET_KEY)?; - let cipher = CipherV2::new(ekey)?; + let cipher = CipherV2::new_from_ekey(ekey.as_str())?; Ok(Self(cipher)) }