/dports/lang/mono/mono-5.10.1.57/external/corefx/src/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/ |
H A D | TripleDesImplementation.cs | 21 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 23 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 31 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 33 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 54 if (rgbKey == null) in CreateTransform() 55 throw new ArgumentNullException(nameof(rgbKey)); in CreateTransform() 57 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 68 if (rgbKey.Length == 16) in CreateTransform() 73 Array.Copy(rgbKey, 0, newkey, 0, 16); in CreateTransform() 74 Array.Copy(rgbKey, 0, newkey, 16, 8); in CreateTransform() [all …]
|
H A D | DesImplementation.cs | 21 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 23 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 31 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 33 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 55 private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateTransform() argument 59 if (rgbKey == null) in CreateTransform() 60 throw new ArgumentNullException(nameof(rgbKey)); in CreateTransform() 62 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 64 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateTransform() 66 if (IsWeakKey(rgbKey)) in CreateTransform() [all …]
|
H A D | AesImplementation.cs | 17 public sealed override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 19 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 27 public sealed override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 29 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 51 private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateTransform() argument 55 if (rgbKey == null) in CreateTransform() 56 throw new ArgumentNullException(nameof(rgbKey)); in CreateTransform() 58 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 60 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateTransform() 69 … return CreateTransformCore(Mode, Padding, rgbKey, rgbIV, BlockSize / BitsPerByte, encrypting); in CreateTransform()
|
H A D | RC2Implementation.cs | 34 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 36 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 44 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 46 return CreateTransform(rgbKey, rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 63 private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateTransform() argument 67 if (rgbKey == null) in CreateTransform() 68 throw new ArgumentNullException(nameof(rgbKey)); in CreateTransform() 70 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 72 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateTransform() 82 …return CreateTransformCore(Mode, Padding, rgbKey, effectiveKeySize, rgbIV, BlockSize / BitsPerByte… in CreateTransform()
|
H A D | RijndaelImplementation.cs | 77 … override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateEncryptor(r… in CreateEncryptor() argument 79 … override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateDecryptor(r… in CreateDecryptor() argument
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/referencesource/mscorlib/system/security/cryptography/ |
H A D | descryptoserviceprovider.cs | 33 public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) { in CreateEncryptor() argument 34 if (IsWeakKey(rgbKey)) in CreateEncryptor() 36 if (IsSemiWeakKey(rgbKey)) in CreateEncryptor() 39 return new DESTransform (this, true, rgbKey, rgbIV); in CreateEncryptor() 47 if (IsWeakKey(rgbKey)) in CreateDecryptor() 49 if (IsSemiWeakKey(rgbKey)) in CreateDecryptor() 53 return new DESTransform (this, false, rgbKey, rgbIV); in CreateDecryptor() 92 if (rgbKey == null) { in _NewEncryptor() 93 rgbKey = new byte[8]; in _NewEncryptor() 94 Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); in _NewEncryptor() [all …]
|
H A D | tripledescryptoserviceprovider.cs | 33 public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) { in CreateEncryptor() argument 34 if (IsWeakKey(rgbKey)) in CreateEncryptor() 37 return new TripleDESTransform (this, true, rgbKey, rgbIV); in CreateEncryptor() 44 public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) { in CreateDecryptor() argument 45 if (IsWeakKey(rgbKey)) in CreateDecryptor() 48 return new TripleDESTransform (this, false, rgbKey, rgbIV); in CreateDecryptor() 89 if (rgbKey == null) { in _NewEncryptor() 90 rgbKey = new byte[KeySizeValue/8]; in _NewEncryptor() 91 Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); in _NewEncryptor() 131 if (rgbKey.Length == 16) { in _NewEncryptor() [all …]
|
H A D | tripledes.cs | 82 public static bool IsWeakKey(byte[] rgbKey) { in IsWeakKey() argument 85 if (!IsLegalKeySize(rgbKey)) { in IsWeakKey() 88 byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey); in IsWeakKey() 98 private static bool EqualBytes(byte[] rgbKey, int start1, int start2, int count) { in EqualBytes() argument 101 …if ((start1+count) > rgbKey.Length) throw new ArgumentException(Environment.GetResourceString("Arg… in EqualBytes() 102 …if ((start2+count) > rgbKey.Length) throw new ArgumentException(Environment.GetResourceString("Arg… in EqualBytes() 105 if (rgbKey[start1+i] != rgbKey[start2+i]) return(false); in EqualBytes() 110 private static bool IsLegalKeySize(byte[] rgbKey) { in IsLegalKeySize() argument 111 if (rgbKey != null && ((rgbKey.Length == 16) || (rgbKey.Length == 24))) in IsLegalKeySize()
|
H A D | rc2cryptoserviceprovider.cs | 71 public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) { in CreateEncryptor() argument 76 return new RC2Transform (this, true, rgbKey, rgbIV); in CreateEncryptor() 78 return _NewEncryptor(rgbKey, ModeValue, rgbIV, EffectiveKeySizeValue, in CreateEncryptor() 84 public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) { in CreateDecryptor() argument 89 return new RC2Transform (this, false, rgbKey, rgbIV); in CreateDecryptor() 91 return _NewEncryptor(rgbKey, ModeValue, rgbIV, EffectiveKeySizeValue, in CreateDecryptor() 126 if (rgbKey == null) { in _NewEncryptor() 127 rgbKey = new byte[KeySizeValue/8]; in _NewEncryptor() 128 Utils.StaticRandomNumberGenerator.GetBytes(rgbKey); in _NewEncryptor() 132 int keySizeValue = rgbKey.Length * 8; in _NewEncryptor() [all …]
|
H A D | rijndaelmanaged.cs | 35 public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) { in CreateEncryptor() argument 36 return NewEncryptor(rgbKey, in CreateEncryptor() 43 public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) { in CreateDecryptor() argument 44 return NewEncryptor(rgbKey, in CreateDecryptor() 59 private ICryptoTransform NewEncryptor (byte[] rgbKey, in NewEncryptor() argument 65 if (rgbKey == null) { in NewEncryptor() 66 rgbKey = Utils.GenerateRandom(KeySizeValue / 8); in NewEncryptor() 82 return new RijndaelManagedTransform (rgbKey, in NewEncryptor()
|
H A D | des.cs | 86 public static bool IsWeakKey(byte[] rgbKey) { in IsWeakKey() argument 87 if (!IsLegalKeySize(rgbKey)) { in IsWeakKey() 90 byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey); in IsWeakKey() 101 public static bool IsSemiWeakKey(byte[] rgbKey) { in IsSemiWeakKey() argument 102 if (!IsLegalKeySize(rgbKey)) { in IsSemiWeakKey() 105 byte[] rgbOddParityKey = Utils.FixupKeyParity(rgbKey); in IsSemiWeakKey() 128 private static bool IsLegalKeySize(byte[] rgbKey) { in IsLegalKeySize() argument 129 if (rgbKey != null && rgbKey.Length == 8) return(true); in IsLegalKeySize()
|
/dports/lang/mono/mono-5.10.1.57/external/corefx/src/System.Security.Cryptography.Csp/src/System/Security/Cryptography/ |
H A D | DESCryptoServiceProvider.Windows.cs | 49 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 51 … return CreateTransform(rgbKey, rgbIV == null ? null : rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 61 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 63 … return CreateTransform(rgbKey, rgbIV == null ? null : rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 67 private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateTransform() argument 71 if (rgbKey == null) in CreateTransform() 72 throw new ArgumentNullException(nameof(rgbKey)); in CreateTransform() 74 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 76 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateTransform() 78 if (IsWeakKey(rgbKey)) in CreateTransform() [all …]
|
H A D | RC2CryptoServiceProvider.Windows.cs | 55 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 57 … return CreateTransform(rgbKey, rgbIV == null ? null : rgbIV.CloneByteArray(), encrypting: true); in CreateEncryptor() 61 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 63 … return CreateTransform(rgbKey, rgbIV == null ? null : rgbIV.CloneByteArray(), encrypting: false); in CreateDecryptor() 82 private ICryptoTransform CreateTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateTransform() argument 86 long keySize = rgbKey.Length * (long)BitsPerByte; in CreateTransform() 88 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateTransform() 109 …icSymmetricCipherCsp(CapiHelper.CALG_RC2, Mode, BlockSize / BitsPerByte, rgbKey, effectiveKeySize,… in CreateTransform()
|
H A D | AesCryptoServiceProvider.cs | 66 … override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateEncryptor(r… in CreateEncryptor() argument 68 … override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateDecryptor(r… in CreateDecryptor() argument
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/corlib/CommonCrypto/ |
H A D | RijndaelManaged.cs | 35 public override ICryptoTransform CreateDecryptor (byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 42 …decryptor = Cryptor.Create (CCOperation.Decrypt, CCAlgorithm.AES128, CCOptions.None, rgbKey, rgbIV… in CreateDecryptor() 45 …decryptor = Cryptor.Create (CCOperation.Decrypt, CCAlgorithm.AES128, CCOptions.ECBMode, rgbKey, rg… in CreateDecryptor() 54 return NewEncryptor(rgbKey, in CreateDecryptor() 61 public override ICryptoTransform CreateEncryptor (byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 67 …encryptor = Cryptor.Create (CCOperation.Encrypt, CCAlgorithm.AES128, CCOptions.None, rgbKey, rgbIV… in CreateEncryptor() 79 return NewEncryptor(rgbKey, in CreateEncryptor() 87 private ICryptoTransform NewEncryptor (byte[] rgbKey, in NewEncryptor() argument 93 if (rgbKey == null) { in NewEncryptor() 94 rgbKey = Utils.GenerateRandom(KeySizeValue / 8); in NewEncryptor() [all …]
|
/dports/lang/mono/mono-5.10.1.57/external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ |
H A D | TripleDES.cs | 61 public static bool IsWeakKey(byte[] rgbKey) in IsWeakKey() argument 63 if (rgbKey == null) in IsWeakKey() 66 if (!(rgbKey.Length*8).IsLegalSize(s_legalKeySizes)) in IsWeakKey() 69 byte[] rgbOddParityKey = rgbKey.FixupKeyParity(); in IsWeakKey() 77 private static bool EqualBytes(byte[] rgbKey, int start1, int start2, int count) in EqualBytes() argument 81 Debug.Assert((start1 + count) <= rgbKey.Length); in EqualBytes() 82 Debug.Assert((start2 + count) <= rgbKey.Length); in EqualBytes() 86 if (rgbKey[start1 + i] != rgbKey[start2 + i]) in EqualBytes()
|
H A D | DES.cs | 62 public static bool IsWeakKey(byte[] rgbKey) in IsWeakKey() argument 64 if (!IsLegalKeySize(rgbKey)) // Also checks for null; same exception in IsWeakKey() 67 byte[] rgbOddParityKey = rgbKey.FixupKeyParity(); in IsWeakKey() 80 public static bool IsSemiWeakKey(byte[] rgbKey) in IsSemiWeakKey() argument 82 if (!IsLegalKeySize(rgbKey)) // Also checks for null; same exception in IsSemiWeakKey() 85 byte[] rgbOddParityKey = rgbKey.FixupKeyParity(); in IsSemiWeakKey() 106 private static bool IsLegalKeySize(byte[] rgbKey) in IsLegalKeySize() argument 108 if (rgbKey != null && rgbKey.Length == 8) in IsLegalKeySize()
|
H A D | AesManaged.cs | 64 … override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateEncryptor(r… in CreateEncryptor() argument 66 … override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateDecryptor(r… in CreateDecryptor() argument
|
H A D | RijndaelManaged.cs | 72 … override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateEncryptor(r… in CreateEncryptor() argument 74 … override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) => _impl.CreateDecryptor(r… in CreateDecryptor() argument
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/Mono.Security/Mono.Security.Cryptography/ |
H A D | TlsHMAC.cs | 109 byte[] rgbKey = new byte[64]; in HMAC() 111 rng.GetNonZeroBytes(rgbKey); in HMAC() 113 KeyValue = (byte[])rgbKey.Clone(); in HMAC() 118 public HMAC (HashAlgorithm ha, byte[] rgbKey) in HMAC() argument 125 if (rgbKey.Length > 64) in HMAC() 127 KeyValue = hash.ComputeHash(rgbKey); in HMAC() 131 KeyValue = (byte[])rgbKey.Clone(); in HMAC()
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/System.IdentityModel/System.IdentityModel.Tokens/ |
H A D | TlsHMAC.cs | 109 byte[] rgbKey = new byte[64]; in HMAC() 111 rng.GetNonZeroBytes(rgbKey); in HMAC() 113 KeyValue = (byte[])rgbKey.Clone(); in HMAC() 118 public HMAC(string hashName, byte[] rgbKey) in HMAC() argument 130 if (rgbKey.Length > 64) in HMAC() 132 KeyValue = hash.ComputeHash(rgbKey); in HMAC() 136 KeyValue = (byte[])rgbKey.Clone(); in HMAC()
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/System.ServiceModel/Mono.Security.Cryptography/ |
H A D | TlsHMAC.cs | 109 byte[] rgbKey = new byte[64]; in HMAC() 111 rng.GetNonZeroBytes(rgbKey); in HMAC() 113 KeyValue = (byte[])rgbKey.Clone(); in HMAC() 118 public HMAC(string hashName, byte[] rgbKey) in HMAC() argument 130 if (rgbKey.Length > 64) in HMAC() 132 KeyValue = hash.ComputeHash(rgbKey); in HMAC() 136 KeyValue = (byte[])rgbKey.Clone(); in HMAC()
|
/dports/lang/mono/mono-5.10.1.57/mcs/class/referencesource/System.IdentityModel/System/IdentityModel/ |
H A D | RijndaelCryptoServiceProvider.cs | 18 public override ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() argument 20 if (rgbKey == null) in CreateEncryptor() 27 … return new RijndaelCryptoTransform(rgbKey, rgbIV, this.PaddingValue, this.BlockSizeValue, true); in CreateEncryptor() 30 public override ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() argument 32 if (rgbKey == null) in CreateDecryptor() 66 if (rgbKey.Length != 16 && rgbKey.Length != 24 && rgbKey.Length != 32) in RijndaelCryptoTransform() 86 int cbData = PLAINTEXTKEYBLOBHEADER.SizeOf + rgbKey.Length; in RijndaelCryptoTransform() 88 … Buffer.BlockCopy(rgbKey, 0, pbData, PLAINTEXTKEYBLOBHEADER.SizeOf, rgbKey.Length); in RijndaelCryptoTransform() 95 if (rgbKey.Length == 16) in RijndaelCryptoTransform() 97 else if (rgbKey.Length == 24) in RijndaelCryptoTransform() [all …]
|
/dports/lang/mono/mono-5.10.1.57/external/corefx/src/System.Security.Cryptography.Cng/src/Internal/Cryptography/ |
H A D | CngSymmetricAlgorithmCore.cs | 113 public ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[] rgbIV) in CreateEncryptor() 115 return CreateCryptoTransform(rgbKey, rgbIV, encrypting: true); in CreateEncryptor() 118 public ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[] rgbIV) in CreateDecryptor() 120 return CreateCryptoTransform(rgbKey, rgbIV, encrypting: false); in CreateDecryptor() 133 private ICryptoTransform CreateCryptoTransform(byte[] rgbKey, byte[] rgbIV, bool encrypting) in CreateCryptoTransform() 135 if (rgbKey == null) in CreateCryptoTransform() 136 throw new ArgumentNullException(nameof(rgbKey)); in CreateCryptoTransform() 138 byte[] key = rgbKey.CloneByteArray(); in CreateCryptoTransform() 142 throw new ArgumentException(SR.Cryptography_InvalidKeySize, nameof(rgbKey)); in CreateCryptoTransform()
|
/dports/lang/mono/mono-5.10.1.57/external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ |
H A D | SymmetricKeyWrap.cs | 23 internal static byte[] TripleDESKeyWrapEncrypt(byte[] rgbKey, byte[] rgbWrappedKeyData) in TripleDESKeyWrapEncrypt() argument 51 enc1 = tripleDES.CreateEncryptor(rgbKey, rgbIV); in TripleDESKeyWrapEncrypt() 52 enc2 = tripleDES.CreateEncryptor(rgbKey, s_rgbTripleDES_KW_IV); in TripleDESKeyWrapEncrypt() 74 … internal static byte[] TripleDESKeyWrapDecrypt(byte[] rgbKey, byte[] rgbEncryptedWrappedKeyData) in TripleDESKeyWrapDecrypt() argument 90 dec1 = tripleDES.CreateDecryptor(rgbKey, s_rgbTripleDES_KW_IV); in TripleDESKeyWrapDecrypt() 100 dec2 = tripleDES.CreateDecryptor(rgbKey, rgbIV); in TripleDESKeyWrapDecrypt() 124 internal static byte[] AESKeyWrapEncrypt(byte[] rgbKey, byte[] rgbWrappedKeyData) in AESKeyWrapEncrypt() argument 137 aes.Key = rgbKey; in AESKeyWrapEncrypt() 186 internal static byte[] AESKeyWrapDecrypt(byte[] rgbKey, byte[] rgbEncryptedWrappedKeyData) in AESKeyWrapDecrypt() argument 200 aes.Key = rgbKey; in AESKeyWrapDecrypt()
|