未验证 提交 a94f6ca7 编写于 作者: K Kevin Jones 提交者: GitHub

Remove Browser implementation of PBKDF2 one-shot

It's the same thing as the managed implementation now
上级 071fe7ce
......@@ -576,7 +576,7 @@
<Compile Include="System\Security\Cryptography\OidLookup.NoFallback.cs" />
<Compile Include="System\Security\Cryptography\OpenSsl.NotSupported.cs" />
<Compile Include="System\Security\Cryptography\PasswordDeriveBytes.NotSupported.cs" />
<Compile Include="System\Security\Cryptography\Pbkdf2Implementation.Browser.cs" />
<Compile Include="System\Security\Cryptography\Pbkdf2Implementation.Managed.cs" />
<Compile Include="System\Security\Cryptography\RandomNumberGeneratorImplementation.Browser.cs" />
<Compile Include="System\Security\Cryptography\RC2CryptoServiceProvider.NotSupported.cs" />
<Compile Include="System\Security\Cryptography\RC2Implementation.NotSupported.cs" />
......
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using Internal.Cryptography;
namespace System.Security.Cryptography
{
internal static partial class Pbkdf2Implementation
{
public static void Fill(
ReadOnlySpan<byte> password,
ReadOnlySpan<byte> salt,
int iterations,
HashAlgorithmName hashAlgorithmName,
Span<byte> destination)
{
Debug.Assert(!destination.IsEmpty);
Debug.Assert(hashAlgorithmName.Name is not null);
FillManaged(password, salt, iterations, hashAlgorithmName, destination);
}
private static void FillManaged(
ReadOnlySpan<byte> password,
ReadOnlySpan<byte> salt,
int iterations,
HashAlgorithmName hashAlgorithmName,
Span<byte> destination)
{
using (Rfc2898DeriveBytes deriveBytes = new Rfc2898DeriveBytes(
password,
salt,
iterations,
hashAlgorithmName))
{
deriveBytes.GetBytes(destination);
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册