Skip to content
Closed
Show file tree
Hide file tree
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 @@ -31,8 +31,8 @@ internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan<byte> d
[GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
internal static partial int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);

[GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
internal static unsafe partial int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);
[DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
internal static unsafe extern int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, uint* mdSize);

[GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
internal static partial int EvpMdSize(IntPtr md);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ internal static partial class Crypto
internal static int HmacUpdate(SafeHmacCtxHandle ctx, ReadOnlySpan<byte> data, int len) =>
HmacUpdate(ctx, ref MemoryMarshal.GetReference(data), len);

[GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
private static partial int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);
[DllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacUpdate")]
private static extern int HmacUpdate(SafeHmacCtxHandle ctx, ref byte data, int len);

[GeneratedDllImport(Libraries.AndroidCryptoNative, EntryPoint = "CryptoNative_HmacFinal")]
internal static partial int HmacFinal(SafeHmacCtxHandle ctx, ref byte data, ref int len);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static jobject GetMessageDigestInstance(JNIEnv* env, intptr_t type)

int32_t CryptoNative_EvpDigestOneShot(intptr_t type, void* source, int32_t sourceSize, uint8_t* md, uint32_t* mdSize)
{
abort_if_invalid_pointer_argument (source);

if (!type || !md || !mdSize || sourceSize < 0)
return FAIL;

abort_if_invalid_pointer_argument (source);

JNIEnv* env = GetJNIEnv();

jobject mdObj = GetMessageDigestInstance(env, type);
Expand Down