Compare commits

...
Author SHA1 Message Date
Si Beaumont 226c73e725 Revert "(split: benchmarks) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 0f0b20b965.
2026-08-07 09:19:47 +01:00
Si Beaumont 6bed8c0239 Only enable CheckImplementationOnly for Swift 6.4+ 2026-08-07 09:18:15 +01:00
Si Beaumont bc748e9db5 Revert "(split: SHA512256) Enable CheckImplementationOnly and box properties where needed"
This reverts commit d6384ee4548e797894add480dfc0ea2b2e55ba1a.
2026-08-07 09:06:21 +01:00
Si Beaumont dbc7ea1646 Revert "(split: XWing) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 1f780b4d25c02733d1433581c3b7e4d8b657d7a5.
2026-08-07 09:06:21 +01:00
Si Beaumont e08fd36acd Revert "(split: MLKEM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 02688bd534232b63581dbfa1a8d39476a0429f19.
2026-08-07 09:06:21 +01:00
Si Beaumont 1c92c8063d Revert "(split: ECDSASignature) Enable CheckImplementationOnly and box properties where needed"
This reverts commit af44bc64c0c87e92933a677a5b8e77f0602157f3.
2026-08-07 09:06:21 +01:00
Si Beaumont 5932f787f8 Revert "(split: MLDSA) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 25fbb8efaf823becd0a3c52e3ba3db93d123e2fe.
2026-08-07 09:06:21 +01:00
Si Beaumont 6e917b8a0c Revert "(split: AEAD) Enable CheckImplementationOnly and box properties where needed"
This reverts commit af3e61654b5d3a0e36ce575d15e27d79b6bd7184.
2026-08-07 09:06:21 +01:00
Si Beaumont 9650914954 Revert "(split: BIGNUM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit d2a3a8dd752f59e2e838a28afaa5c7c4f7f48f5a.
2026-08-07 09:06:21 +01:00
Si Beaumont 529e520206 Reapply "(split: SHA512256) Enable CheckImplementationOnly and box properties where needed"
This reverts commit dcb8db367de313cfb98acb3f52b3d83eeb81e4f5.
2026-08-06 14:16:47 +01:00
Si Beaumont 86a77f7140 Reapply "(split: XWing) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 3f4136ae8d8bf06851ee12ada60a8759a5f62a62.
2026-08-06 14:16:47 +01:00
Si Beaumont 549795f323 Reapply "(split: MLKEM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit f5b3e148e546740dc926a4f133fdac918c79bda1.
2026-08-06 14:16:47 +01:00
Si Beaumont 74c924555e Reapply "(split: ECDSASignature) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 7f3eaa188ad5d5f1441f701a8c0302ee92cbb09f.
2026-08-06 14:16:47 +01:00
Si Beaumont 0fe7a8e839 Reapply "(split: MLDSA) Enable CheckImplementationOnly and box properties where needed"
This reverts commit ca023c479b7e268dacdb3a5d2265c41532230d7f.
2026-08-06 14:16:47 +01:00
Si Beaumont f0f7a965e0 Reapply "(split: AEAD) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 0dd9f706777cad2b10526087519c0d01d321a65a.
2026-08-06 14:16:47 +01:00
Si Beaumont 88c237b314 Reapply "(split: BIGNUM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 32d7b6edae15d232d6f6fa7043443832e18249c3.
2026-08-06 14:16:47 +01:00
Si Beaumont c7b6553a08 Revert "(split: SHA512256) Enable CheckImplementationOnly and box properties where needed"
This reverts commit d6384ee4548e797894add480dfc0ea2b2e55ba1a.
2026-08-06 14:16:47 +01:00
Si Beaumont 56f26fd233 Revert "(split: XWing) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 1f780b4d25c02733d1433581c3b7e4d8b657d7a5.
2026-08-06 14:16:47 +01:00
Si Beaumont 9d8037097c Revert "(split: MLKEM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 02688bd534232b63581dbfa1a8d39476a0429f19.
2026-08-06 14:16:47 +01:00
Si Beaumont 3c7d51f9df Revert "(split: ECDSASignature) Enable CheckImplementationOnly and box properties where needed"
This reverts commit af44bc64c0c87e92933a677a5b8e77f0602157f3.
2026-08-06 14:16:47 +01:00
Si Beaumont c1718e4722 Revert "(split: MLDSA) Enable CheckImplementationOnly and box properties where needed"
This reverts commit 25fbb8efaf823becd0a3c52e3ba3db93d123e2fe.
2026-08-06 14:16:47 +01:00
Si Beaumont c78a61b4d0 Revert "(split: AEAD) Enable CheckImplementationOnly and box properties where needed"
This reverts commit af3e61654b5d3a0e36ce575d15e27d79b6bd7184.
2026-08-06 14:16:47 +01:00
Si Beaumont 10cec03e61 Revert "(split: BIGNUM) Enable CheckImplementationOnly and box properties where needed"
This reverts commit d2a3a8dd752f59e2e838a28afaa5c7c4f7f48f5a.
2026-08-06 14:16:47 +01:00
Si Beaumont bc7a820fd8 Update swiftlang/github-workflows to 0.0.13 2026-08-06 14:16:47 +01:00
Si Beaumont db7a5b2863 Build with -warnings-as-errors in CI (exclude ImplementationOnlyDeprecated)
We want to lock in the win of getting this package warnings-clean. We
usually do this by building with `-warnings-as-errors` in CI. We still
have one warning, which we need to tolerate until we drop support for
6.3, which is `ImplementationOnlyDeprecated`, but we can still lock in
the win by building with the following flags in CI to downgrade
`ImplementationOnlyDeprecated` back to a warning:

    -Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated

This patch updates the pull request GitHub workflow to build with these
flags.
2026-08-06 14:16:47 +01:00
Si Beaumont ad74759b96 Silence ImplementationOnlyDeprecated for Swift 6.4+
This project is currently warnings-as-errors clean, but only because we
suppress `ImplementationOnlyDeprecated` warnings, using the following:

```
-Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated
```

With this setup, the warnings are still generated and are noisy.

Swift 6.4 introduces `SourceWarningControl`, which we can use to
actually _silence_ these warnings, using `@diagnose(_:as:)`.

This patch adds a dance around the `@_implementationOnly imports`:

    #if hasFeature(SourceWarningControl)
    @diagnose(ImplementationOnlyDeprecated, as: ignored)
    #endif
    @_implementationOnly import ...

On Swift 6.4, this project is now warnings free.

When we raise the minimum supported Swift compiler version to one that
supports `SourceWarningControl`, we can remove the `#if hasFeature`
guards.
2026-08-06 14:16:47 +01:00
Si Beaumont 70712b39f7 (split: SHA512256) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont 451fdb305b (split: XWing) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont eca81332d9 (split: MLKEM) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont 4304fd7dcf (split: ECDSASignature) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont 61e60e023b (split: MLDSA) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont 2cf2acbd9b (split: AEAD) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont b810e1a634 (split: BIGNUM) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 14:16:47 +01:00
Si Beaumont 1416991053 (split: setting) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 07:34:22 +01:00
Si Beaumont 0f0b20b965 (split: benchmarks) Enable CheckImplementationOnly and box properties where needed
We've long since used `@_implementationOnly import` (IOI) for our
vendored C modules (BoringSSL and libXKCP) in an attempt to not leak our
dependency into downstream builds. This is important because leaking
might cause symbol collisions (build failures) or, worse, layout
mismatches (latent runtime failures).

IOI was intended to be used with library evolution, which this project
does not support, and use of IOI without library evolution has been
soft-deprecated. Users are encouraged to move to `internal import` (II),
which is usually the right choice for Swift packages. But II does _not_
provide the same guarantees as IOI and, for this project, we really need
the protections given by IOI so we will continue to use it, even with
library evolution disabled.

One of the reasons for the soft-deprecation was the implementation of
IOI used an incomplete checker, that won't catch all interface leaks
without library evolution. However, Swift has also introduced a new
feature, `CheckImplementationOnly` (CIO), which enables the stricter
interface checking that we need.

Enabling CIO for this project today actually exposes a number of places
where we _are_ leaking the C types into our interface in ways that could
cause build- or runtime problems in downstream projects, and rightly
causes the build to fail. These types will need to have their C struct
members boxed behind an `OpaquePointer`.

This patch enables CIO, and adds the required boxing to the offending
types.

The public API is unchanged.

Additional refactoring is also done to ensure a single designated
initializer, responsible for the allocation, forcing all convenience
initializers through an `init(takingOwnershipOf:)` spelling, to reduce
the chances of introducing future double free bugs in complex
initializers.

This patch also adds some benchmarks for some of the paths that would be
implicated by these changes. While they show the expected increase in
allocations, there's only a modest-to-negligible performance regression,
since the majority of the compute is dominated by the time spent doing
the crypto routines in the C library themselves.
2026-08-06 07:33:46 +01:00
Si Beaumont 60572672b1 Add vendored-sources.txt to excludes to remove SwiftPM warning 2026-08-05 13:25:40 +01:00
Si Beaumont ff138e8694 Drop public import where needed to resolve UnusedImportAccess warning 2026-08-05 13:23:59 +01:00
Si Beaumont 4ebd26ddef Use ExistentialAny keyword in tests to resolve warning in 6.4 2026-08-05 13:23:00 +01:00
Si Beaumont 8979b7465c Remove try keywords to resolve UnnecessaryEffectMarker warnings 2026-08-05 13:22:07 +01:00
Si Beaumont 9fc4058c1d Disable macro-redefined warnings in CXKCP target 2026-08-05 13:22:07 +01:00
Si Beaumont cc50346097 Disable shorten-64-to-32 warnings in BoringSSL target 2026-08-05 10:11:35 +01:00
48 changed files with 249 additions and 33 deletions

No files matched your search

+9 -14
View File
@@ -10,7 +10,7 @@ on:
jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.7
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@0.0.13
with:
license_header_check_project_name: "SwiftCrypto"
docs_check_enabled: false
@@ -19,28 +19,23 @@ jobs:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_1_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_2_arguments_override: "--explicit-target-dependency-import-check error"
linux_6_3_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
windows_6_1_enabled: true
linux_6_2_arguments_override: "-Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
linux_6_3_arguments_override: "-Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
linux_nightly_next_arguments_override: "--build-system native -Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
linux_nightly_main_arguments_override: "--build-system native --explicit-target-dependency-import-check error"
windows_6_2_enabled: true
windows_6_3_enabled: true
windows_nightly_next_enabled: true
windows_nightly_main_enabled: true
windows_6_1_arguments_override: "--explicit-target-dependency-import-check error"
windows_6_2_arguments_override: "--explicit-target-dependency-import-check error"
windows_6_3_arguments_override: "--explicit-target-dependency-import-check error"
windows_nightly_next_arguments_override: "--explicit-target-dependency-import-check error"
windows_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
windows_6_2_arguments_override: "-Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
windows_6_3_arguments_override: "-Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
windows_nightly_next_arguments_override: "--build-system native -Xswiftc -warnings-as-errors -Xswiftc -Wwarning -Xswiftc ImplementationOnlyDeprecated --explicit-target-dependency-import-check error"
windows_nightly_main_arguments_override: "--build-system native --explicit-target-dependency-import-check error"
release-builds:
name: Release builds
uses: apple/swift-nio/.github/workflows/release_builds.yml@main
with:
windows_6_1_enabled: true
windows_6_2_enabled: true
windows_6_3_enabled: true
windows_nightly_next_enabled: true
+13 -1
View File
@@ -38,11 +38,17 @@ let nonDarwinPlatforms: [Platform] = [
.custom("freebsd"),
]
let swiftSettings: [SwiftSetting] = [
var swiftSettings: [SwiftSetting] = [
.define("CRYPTO_IN_SWIFTPM"),
.enableExperimentalFeature("Lifetimes"),
.enableExperimentalFeature("SourceWarningControl"),
]
// Only enable CheckImplementationOnly on 6.4 -- 6.3 has the feature, but produces many false positives.
#if compiler(>=6.4)
swiftSettings.append(.enableExperimentalFeature("CheckImplementationOnly"))
#endif
// This doesn't work when cross-compiling: the privacy manifest will be included in the Bundle and
// Foundation will be linked. This is, however, strictly better than unconditionally adding the
// resource.
@@ -98,6 +104,10 @@ let package = Package(
.when(platforms: [Platform.wasi])
),
.define("OPENSSL_NO_ASM", .when(platforms: [Platform.wasi])),
// BoringSSL is vendored verbatim; we don't fix its warnings. Xcode enables
// -Wshorten-64-to-32 by default (SwiftPM does not), which produces dozens
// of warnings. Silence that group here.
.disableWarning("shorten-64-to-32"),
]
),
.target(
@@ -113,6 +123,7 @@ let package = Package(
.headerSearchPath("low/KeccakP-1600"),
.headerSearchPath("low/common"),
.headerSearchPath("common"),
.disableWarning("macro-redefined"),
]
),
.target(
@@ -141,6 +152,7 @@ let package = Package(
.target(name: "CXKCPShims", condition: .when(platforms: nonDarwinPlatforms)),
],
exclude: privacyManifestExclude + [
"vendored-sources.txt",
"CMakeLists.txt",
"Signatures/BoringSSL/MLDSA_boring.swift.gyb",
"KEM/BoringSSL/MLKEM_boring.swift.gyb",
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
protocol HashFunctionImplementationDetails: HashFunction where Digest: DigestPrivate {}
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CXKCP
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CXKCPShims
#else
@_implementationOnly import CXKCP
@_implementationOnly import CXKCPShims
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
protocol XKCPBackedHashFunction: HashFunctionImplementationDetails {
@@ -19,7 +19,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -19,7 +19,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -15,7 +15,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -15,7 +15,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
extension P256.KeyAgreement.PrivateKey {
+2 -2
View File
@@ -17,9 +17,9 @@
#else
#if canImport(FoundationEssentials)
public import FoundationEssentials
import FoundationEssentials
#else
public import Foundation
import Foundation
#endif
internal struct ANSIKDFx963<H: HashFunction>: Sendable {
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -14,8 +14,13 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -15,7 +15,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -26,7 +30,11 @@ import Foundation
// any edits of this file WILL be overwritten and thus discarded
// see section `gyb` in `README` for details.
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -15,7 +15,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -26,7 +30,11 @@ import Foundation
// any edits of this file WILL be overwritten and thus discarded
// see section `gyb` in `README` for details.
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -15,7 +15,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,7 +14,11 @@
#if canImport(CryptoKit)
@_exported import CryptoKit
#else
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
extension CryptoKitError {
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if !canImport(Darwin)
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias errno_t = CInt
@@ -12,8 +12,13 @@
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
public enum CryptoBoringWrapperError: Error {
@@ -11,7 +11,11 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
/// A wrapper around BoringSSL's EC_GROUP object that handles reference counting and
/// liveness.
@@ -11,8 +11,13 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import protocol FoundationEssentials.ContiguousBytes
@@ -12,8 +12,13 @@
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -13,8 +13,13 @@
//===----------------------------------------------------------------------===//
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -13,8 +13,13 @@
//===----------------------------------------------------------------------===//
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -14,11 +14,17 @@
// This is a copy ChaChaPoly_boring just with a different set aes algos
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
import Crypto
import CryptoBoringWrapper
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -92,7 +98,7 @@ enum OpenSSLAESGCMSIVImpl {
)
}
return try AES.GCM._SIV.SealedBox(combined: combined, nonceByteCount: nonce.bytes.count)
return AES.GCM._SIV.SealedBox(combined: combined, nonceByteCount: nonce.bytes.count)
}
@inlinable
+7 -1
View File
@@ -11,9 +11,15 @@
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -12,11 +12,17 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
import Crypto
import CryptoBoringWrapper
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -12,8 +12,13 @@
//
//===----------------------------------------------------------------------===//
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
import Crypto
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
#if canImport(Darwin)
import Darwin
#endif
@@ -20,8 +20,13 @@ import Foundation
#endif
#if !canImport(CommonCrypto)
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
internal struct BoringSSLPBKDF2 {
@@ -12,9 +12,15 @@
//
//===----------------------------------------------------------------------===//
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
import Crypto
#endif
#if canImport(FoundationEssentials)
#if os(Windows)
+9 -3
View File
@@ -12,12 +12,18 @@
//
//===----------------------------------------------------------------------===//
// NOTE: This file is unconditionally compiled because RSABSSA is implemented using BoringSSL on all platforms.
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
import Crypto
import CryptoBoringWrapper
// NOTE: This file is unconditionally compiled because RSABSSA is implemented using BoringSSL on all platforms.
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
#if os(Windows)
import ucrt
@@ -12,7 +12,11 @@
//
//===----------------------------------------------------------------------===//
#if !canImport(Darwin)
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias errno_t = CInt
@@ -13,8 +13,13 @@
//===----------------------------------------------------------------------===//
// NOTE: This file is unconditionally compiled because RSABSSA is implemented using BoringSSL on all platforms.
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSLShims
#else
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
#endif
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
@@ -12,9 +12,14 @@
//
//===----------------------------------------------------------------------===//
@_implementationOnly import CCryptoBoringSSL
import Crypto
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
extension CryptoKitError {
/// A helper function that packs the value of `ERR_get_error` into the internal error field.
@@ -13,7 +13,11 @@
//===----------------------------------------------------------------------===//
// NOTE: This file is unconditionally compiled because RSABSSA is implemented using BoringSSL on all platforms.
#if hasFeature(SourceWarningControl)
@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL
#else
@_implementationOnly import CCryptoBoringSSL
#endif
import Crypto
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
+1 -1
View File
@@ -45,7 +45,7 @@ final class AES_CFBTests: XCTestCase {
func testVector(_ vector: TestVector) throws {
let (contiguousPlaintextData, discontiguousPlaintextData) = vector.plaintext.asDataProtocols()
for plaintextData in [contiguousPlaintextData as DataProtocol, discontiguousPlaintextData as DataProtocol] {
for plaintextData in [contiguousPlaintextData as (any DataProtocol), discontiguousPlaintextData as (any DataProtocol)] {
let key = SymmetricKey(data: Data(vector.key))
let iv = try AES._CFB.IV(ivBytes: vector.iv)
let ciphertext = try AES._CFB.encrypt(plaintextData, using: key, iv: iv)
@@ -151,7 +151,7 @@ class AESGCMTests: XCTestCase {
let ciphertext = Array("This pretty clearly isn't ciphertext, but sure why not".utf8)
let (contiguousCiphertext, discontiguousCiphertext) = ciphertext.asDataProtocols()
let contiguousSB = try orFail { try AES.GCM.SealedBox(combined: contiguousCiphertext) }
let contiguousSB = try orFail { AES.GCM.SealedBox(combined: contiguousCiphertext) }
let discontiguousSB = try orFail { try AES.GCM.SealedBox(combined: discontiguousCiphertext) }
XCTAssertEqual(contiguousSB.combined, discontiguousSB.combined)
XCTAssertEqual(Array(contiguousSB.nonce), Array(discontiguousSB.nonce))