-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
ML-KEM: OpenSSL Part 1 #113719
ML-KEM: OpenSSL Part 1 #113719
Conversation
...libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.KemAlgs.cs
Show resolved
Hide resolved
src/libraries/Microsoft.Bcl.Cryptography/src/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/System.Security.Cryptography/src/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/MLKemTests.Encapsulation.cs
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/MLKemTests.Encapsulation.cs
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/MLKemTests.Keys.cs
Show resolved
Hide resolved
[ConditionalFact(typeof(MLKem), nameof(MLKem.IsSupported))] | ||
public static void ExportPrivateSeed_OnlyHasDecapsulationKey() | ||
{ | ||
MLKemGenerateTestVector vector = MLKemGenerateTestVectors.First(); | ||
using MLKem kem = MLKem.ImportDecapsulationKey( | ||
vector.Algorithm, | ||
vector.DecapsulationKey.HexToByteArray()); | ||
|
||
Assert.Throws<CryptographicException>(() => kem.ExportPrivateSeed( | ||
new byte[MLKem.PrivateSeedSizeInBytes])); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we'll have it later, but a template method boundary conditions test could import a decaps key (and/or encaps key) then call export on the seed with the wrong size, and we show that ExportPrivateSeedCore never got called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add this to my scenario of "test cases when we have derived types" where "derived type = stub"
src/libraries/Common/tests/System/Security/Cryptography/MLKemTests.Keys.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/System/Security/Cryptography/MLKemTests.Keys.cs
Show resolved
Hide resolved
...System.Security.Cryptography/src/System/Security/Cryptography/MLKemImplementation.OpenSsl.cs
Show resolved
Hide resolved
src/native/libs/System.Security.Cryptography.Native/osslcompat_30.h
Outdated
Show resolved
Hide resolved
src/native/libs/System.Security.Cryptography.Native/pal_evp_kem.c
Outdated
Show resolved
Hide resolved
src/native/libs/System.Security.Cryptography.Native/osslcompat_30.h
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So long as that one header uses a style consistently, LGTM
This brings in the minimum implementation to have a testable implementation of ML-KEM on Linux.
What is in this PR:
IsSupported
asfalse
until a Windows implementation is available)What is not in this PR:
MLKemOpenSsl
, etc)Contributes to #113508