Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,6 @@ internal static partial class Crypto
[LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_GetMaxMdSize")]
private static partial int GetMaxMdSize();

[LibraryImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_Pbkdf2")]
private static unsafe partial int Pbkdf2(
byte* pPassword,
int passwordLength,
byte* pSalt,
int saltLength,
int iterations,
IntPtr digestEvp,
byte* pDestination,
int destinationLength);

internal static unsafe int Pbkdf2(
ReadOnlySpan<byte> password,
ReadOnlySpan<byte> salt,
int iterations,
IntPtr digestEvp,
Span<byte> destination)
{
fixed (byte* pPassword = password)
fixed (byte* pSalt = salt)
fixed (byte* pDestination = destination)
{
return Pbkdf2(
pPassword,
password.Length,
pSalt,
salt.Length,
iterations,
digestEvp,
pDestination,
destination.Length);
}
}

internal static readonly int EVP_MAX_MD_SIZE = GetMaxMdSize();
}
}