public abstract Decrypt ( ArraySegment |
||
src | ArraySegment |
|
dst | ArraySegment |
|
in_header | string | |
Résultat | System.Int64 |
protected bool decryptMessage(ArraySegment <byte> buffer, string encryption_type, string encryption_header) { EncryptionType type = (EncryptionType)Convert.ToInt32(encryption_type); if (!encryptors_.ContainsKey(type)) { Log("Unknown encryption: {0}", type); return(false); } Encryptor encryptor = encryptors_[type]; if (encryptor == null) { Log("Invalid encryption: {0}", type); return(false); } Int64 nSize = encryptor.Decrypt(buffer, buffer, encryption_header); if (nSize <= 0) { Log("Failed to decrypt."); return(false); } return(true); }
protected bool decryptMessage(ArraySegment <byte> buffer, string encryption_type, string encryption_header) { EncryptionType type = (EncryptionType)Convert.ToInt32(encryption_type); if (type == EncryptionType.kDummyEncryption) { return(true); } if (!encryptors_.ContainsKey(type)) { debug.LogWarning("Encryptor.decryptMessage - Unavailable type: {0}", type); return(false); } Encryptor encryptor = encryptors_[type]; Int64 nSize = encryptor.Decrypt(buffer, buffer, encryption_header); if (nSize <= 0) { debug.LogWarning("Encryptor.decryptMessage - Failed to decrypt."); return(false); } return(true); }