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

◆ CreateTransform()

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

Definition at line 44 of file TripleDesImplementation.cs.

45 {
46 if (rgbKey == null)
47 {
48 throw new ArgumentNullException("rgbKey");
49 }
50 long num = (long)rgbKey.Length * 8L;
51 if (num > int.MaxValue || !((int)num).IsLegalSize(LegalKeySizes))
52 {
54 }
55 if (rgbIV != null)
56 {
57 long num2 = (long)rgbIV.Length * 8L;
58 if (num2 != BlockSize)
59 {
61 }
62 }
63 if (rgbKey.Length == 16)
64 {
65 byte[] array = new byte[24];
66 Array.Copy(rgbKey, array, 16);
67 Array.Copy(rgbKey, 0, array, 16, 8);
68 rgbKey = array;
69 }
70 if (Mode == CipherMode.CFB)
71 {
73 }
74 return CreateTransformCore(Mode, Padding, rgbKey, rgbIV, BlockSize / 8, this.GetPaddingSize(Mode, FeedbackSize), FeedbackSize / 8, encrypting);
75 }
static UniversalCryptoTransform CreateTransformCore(CipherMode cipherMode, PaddingMode paddingMode, byte[] key, byte[] iv, int blockSize, int paddingSize, int feedbackSize, bool encrypting)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static string Cryptography_InvalidKeySize
Definition SR.cs:92
static string Cryptography_InvalidIVSize
Definition SR.cs:102
Definition SR.cs:7

References System.array, System.Security.Cryptography.SymmetricAlgorithm.BlockSize, System.Array.Copy(), Internal.Cryptography.TripleDesImplementation.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.TripleDesImplementation.ValidateCFBFeedbackSize().

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