diff --git a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/SlhDsaContractTests.cs b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/SlhDsaContractTests.cs index 33c22de91afbc0..5b1eb6b41969bc 100644 --- a/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/SlhDsaContractTests.cs +++ b/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/SlhDsaContractTests.cs @@ -605,30 +605,6 @@ public static void ExportPkcs8PrivateKey_Resizes(SlhDsaAlgorithm algorithm) AssertExtensions.SequenceEqual(pkcs8.PrivateKey.Span, exportedPkcs8.PrivateKey.Span); } - [Theory] - [MemberData(nameof(SlhDsaTestData.AlgorithmsData), MemberType = typeof(SlhDsaTestData))] - public static void ExportPkcs8PrivateKey_ResizeTerminates(SlhDsaAlgorithm algorithm) - { - using SlhDsaMockImplementation slhDsa = SlhDsaMockImplementation.Create(algorithm); - - int previousSize = -1; - slhDsa.TryExportPkcs8PrivateKeyCoreHook = (Span destination, out int bytesWritten) => - { - // Return false to force a resize - bool ret = false; - - AssertExtensions.GreaterThan(destination.Length, previousSize); - previousSize = destination.Length; - bytesWritten = 0; - - return ret; - }; - - // The loop should terminate with an OverflowException or OutOfMemoryException - AssertExtensions.ThrowsAny(() => slhDsa.ExportPkcs8PrivateKey()); - AssertExtensions.GreaterThan(slhDsa.TryExportPkcs8PrivateKeyCoreCallCount, 0); - } - [Theory] [MemberData(nameof(SlhDsaTestData.AlgorithmsData), MemberType = typeof(SlhDsaTestData))] public static void ExportPkcs8PrivateKey_IgnoreReturnValue(SlhDsaAlgorithm algorithm)