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

◆ CreateTransform()

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

Definition at line 54 of file RC2Implementation.cs.

55 {
56 if (rgbKey == null)
57 {
58 throw new ArgumentNullException("rgbKey");
59 }
60 if (!ValidKeySize(rgbKey.Length, out var keySizeBits))
61 {
63 }
64 if (rgbIV != null)
65 {
66 long num = (long)rgbIV.Length * 8L;
67 if (num != BlockSize)
68 {
70 }
71 }
72 if (Mode == CipherMode.CFB)
73 {
75 }
76 int effectiveKeyLength = ((EffectiveKeySizeValue == 0) ? keySizeBits : EffectiveKeySize);
77 return CreateTransformCore(Mode, Padding, rgbKey, effectiveKeyLength, rgbIV, BlockSize / 8, FeedbackSize / 8, GetPaddingSize(), encrypting);
78 }
static void ValidateCFBFeedbackSize(int feedback)
static UniversalCryptoTransform CreateTransformCore(CipherMode cipherMode, PaddingMode paddingMode, byte[] key, int effectiveKeyLength, byte[] iv, int blockSize, int feedbackSize, int paddingSize, bool encrypting)
bool ValidKeySize(int keySizeBytes, out int keySizeBits)
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.RC2Implementation.CreateTransformCore(), System.SR.Cryptography_InvalidIVSize, System.SR.Cryptography_InvalidKeySize, Internal.Cryptography.RC2Implementation.EffectiveKeySize, System.Security.Cryptography.RC2.EffectiveKeySizeValue, System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize, Internal.Cryptography.RC2Implementation.GetPaddingSize(), System.L, System.Security.Cryptography.SymmetricAlgorithm.Padding, Internal.Cryptography.RC2Implementation.ValidateCFBFeedbackSize(), and Internal.Cryptography.RC2Implementation.ValidKeySize().

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