-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Enable ML-DSA on Windows #116291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable ML-DSA on Windows #116291
Changes from 3 commits
20b4e85
36f926d
fd3da7c
9284e7c
6bd053e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
using Microsoft.Win32.SafeHandles; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class BCrypt | ||
{ | ||
[LibraryImport(Libraries.BCrypt, StringMarshalling = StringMarshalling.Utf16)] | ||
internal static unsafe partial NTSTATUS BCryptSetProperty( | ||
SafeBCryptHandle hObject, | ||
string pszProperty, | ||
void* pbInput, | ||
int cbInput, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most other places use int for cb and |
||
int dwFlags); | ||
|
||
internal static unsafe void BCryptSetSZProperty(SafeBCryptHandle hObject, string pszProperty, string pszValue) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with the helper, I think, but once we're adding it we should use it. So as a followup to this PR we should delete the |
||
{ | ||
fixed (void* pbInput = pszValue) | ||
{ | ||
NTSTATUS status = BCryptSetProperty( | ||
hObject, | ||
pszProperty, | ||
pbInput, | ||
(pszValue.Length + 1) * 2, | ||
PranavSenthilnathan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
0); | ||
|
||
if (status != NTSTATUS.STATUS_SUCCESS) | ||
{ | ||
throw CreateCryptographicException(status); | ||
} | ||
} | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.