From 95f10fa4658d788eef0ea810f9b3925f2df7fc2c Mon Sep 17 00:00:00 2001 From: Harshita Yadav Date: Fri, 31 Jul 2026 13:56:09 +0530 Subject: [PATCH] test(ecdh): enable P-521 tests on Safari --- lib/src/impl_interface/impl_interface.dart | 12 +----------- lib/src/testing/webcrypto/ecdh.dart | 5 +---- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/src/impl_interface/impl_interface.dart b/lib/src/impl_interface/impl_interface.dart index c972ac58..659be0ef 100644 --- a/lib/src/impl_interface/impl_interface.dart +++ b/lib/src/impl_interface/impl_interface.dart @@ -40,17 +40,7 @@ typedef KeyPair = ({T privateKey, S publicKey}); /// /// > [!NOTE] /// > Additional values may be added to this enum in the future. -enum EllipticCurve { - p256, - p384, - - /// - /// - /// P-521 is **not supported on Safari**, see [bug 216755 (bugs.webkit.org)][1]. - /// - /// [1]: https://bugs.webkit.org/show_bug.cgi?id=216755 - p521, -} +enum EllipticCurve { p256, p384, p521 } /// Thrown when an operation failed for an operation-specific reason. final class OperationError extends Error { diff --git a/lib/src/testing/webcrypto/ecdh.dart b/lib/src/testing/webcrypto/ecdh.dart index d8202aa0..e4aa1ef3 100644 --- a/lib/src/testing/webcrypto/ecdh.dart +++ b/lib/src/testing/webcrypto/ecdh.dart @@ -15,7 +15,6 @@ import 'package:webcrypto/webcrypto.dart'; import '../utils/utils.dart'; import '../utils/testrunner.dart'; -import '../utils/detected_runtime.dart'; final runner = TestRunner.asymmetric( algorithm: 'ECDH', @@ -170,9 +169,7 @@ final _testData = [ "deriveParams": {}, }, - /// Safari and WebKit on Mac (with CommonCrypto) does not support P-521, see: - /// https://bugs.webkit.org/show_bug.cgi?id=216755 - ...(nullOnSafari(_testDataWithP521) ?? []), + ..._testDataWithP521, // TODO: generate on firefox, once the import/export pkcs8 has been figured out ];