Motivation
The Swift 6 language mode adopts data-race safety by default. While
Swift Crypto itself has no concurrent code, it is still useful to force
us to ensure that our code is properly Sendable-correct.
Modifications
- @unchecked Sendable on several CoW data types
- Some necessary Sendable constraints on ECToolbox protocols
- Add some missing protocol constraints on ARC types.
Result
Swift 6 clean.
This PR sets swift-crypto up for alignment with the WWDC 2025 CryptoKit
APIs. This includes the parity APIs for MLKEM and MLDSA, as well as
XWing.
At this time the SHA3 APIs are disabled, as they require a novel
implementation strategy. This will come later in the summer. All API
features that require SHA3 are therefore also disabled at runtime.
Motivation:
At WWDC 2020 Apple updated the CryptoKit APIs. This PR brings those new
APIs to Swift Crypto. This brings Swift Crypto up-to-date with the
latest CryptoKit API support, including PEM/DER key support and HKDF API
extensions.
Modifications:
- Bring forward the CryptoKit API files
- Update to have API match the WWDC seed.
Result:
Users will have access to the seed APIs.
Motiviation:
One `let` was hiding as a `var` and a few `#file` parameters have been
forwarded to (now) `#filePath` ones.
Modification:
- make the `var` a `let`
- silence the `#file`/`#filePath` warning by adding `(#file)` because we
can't forward them properly right now
(https://bugs.swift.org/browse/SR-12934). That's okay because even on
the Swift master branch, `#file` == `#filePath`.
Result:
No warnings in newer Swift compilers.