Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateTransform()

ICryptoTransform Internal.Cryptography.AesImplementation.CreateTransform ( byte[] rgbKey,
byte[] rgbIV,
bool encrypting )
inlineprivate

Definition at line 100 of file AesImplementation.cs.

101 {
102 if (rgbKey == null)
103 {
104 throw new ArgumentNullException("rgbKey");
105 }
106 long num = (long)rgbKey.Length * 8L;
107 if (num > int.MaxValue || !((int)num).IsLegalSize(LegalKeySizes))
108 {
110 }
111 if (rgbIV != null)
112 {
113 long num2 = (long)rgbIV.Length * 8L;
114 if (num2 != BlockSize)
115 {
117 }
118 }
119 if (Mode == CipherMode.CFB)
120 {
122 }
123 return CreateTransformCore(Mode, Padding, rgbKey, rgbIV, BlockSize / 8, this.GetPaddingSize(Mode, FeedbackSize), FeedbackSize / 8, encrypting);
124 }
static void ValidateCFBFeedbackSize(int feedback)
static UniversalCryptoTransform CreateTransformCore(CipherMode cipherMode, PaddingMode paddingMode, byte[] key, byte[] iv, int blockSize, int paddingSize, int feedbackSize, bool encrypting)
static string Cryptography_InvalidKeySize
Definition SR.cs:92
static string Cryptography_InvalidIVSize
Definition SR.cs:102
Definition SR.cs:7

References System.Security.Cryptography.SymmetricAlgorithm.BlockSize, Internal.Cryptography.AesImplementation.CreateTransformCore(), System.SR.Cryptography_InvalidIVSize, System.SR.Cryptography_InvalidKeySize, System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize, System.L, System.Security.Cryptography.SymmetricAlgorithm.LegalKeySizes, System.Security.Cryptography.SymmetricAlgorithm.Padding, and Internal.Cryptography.AesImplementation.ValidateCFBFeedbackSize().

Referenced by Internal.Cryptography.AesImplementation.CreateDecryptor(), Internal.Cryptography.AesImplementation.CreateDecryptor(), Internal.Cryptography.AesImplementation.CreateEncryptor(), and Internal.Cryptography.AesImplementation.CreateEncryptor().