internal MD5Wrapper() { #if DOTNET5_4 this.useV1MD5 = CloudStorageAccount.UseV1MD5 || !Interop.CrossPlatformHelpers.IsWindows; if (useV1MD5) { this.hash = IncrementalHash.CreateHash(HashAlgorithmName.MD5); } else { this.nativeMd5 = new NativeMD5(); } #else if (CloudStorageAccount.UseV1MD5) { this.hash = new MD5CryptoServiceProvider(); } else { this.hash = new NativeMD5(); } #endif }
/// <summary> /// Initializes a new instance of NativeMD5. /// </summary> public NativeMD5() : base() { NativeMD5.ValidateReturnCode(NativeMethods.CryptAcquireContextW(out this.hashProv, null, null, ProvRsaFull, CryptVerifyContext)); this.Initialize(); }