Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e9de693
Add an external mu variant of the ML-DSA API (65 and 87 variants)
fpseverino Jun 4, 2025
b5dde9c
Bring swift-crypto up to date with CryptoKit 2025 Beta 1 (#359)
Lukasa Jun 16, 2025
e09d149
Revert "Add an external mu variant of the ML-DSA API (65 and 87 varia…
fpseverino Jun 16, 2025
e25c941
Add an external mu variant of the ML-DSA API (65 and 87 variants)
fpseverino Jun 4, 2025
e016958
Revert "Add an external mu variant of the ML-DSA API (65 and 87 varia…
fpseverino Jun 16, 2025
2688efb
Merge branch 'mldsa-external-mu' of https://github.com/fpseverino/swi…
fpseverino Jun 16, 2025
74c97de
Add external mu variant of ML-DSA to BoringSSL implementation
fpseverino Jun 16, 2025
a6213d7
Add external mu API to wrapper with `package` level
fpseverino Jun 16, 2025
bc935ac
Expose external mu API in CryptoExtras
fpseverino Jun 16, 2025
f8ed3ee
Add tests for external mu variant
fpseverino Jun 16, 2025
64aa6ca
Small formatting fixes
fpseverino Jun 16, 2025
fdb09e2
Use computed variable to get BoringSSL implementation
fpseverino Jun 16, 2025
f8bb7ef
Add `@testable` back in tests
fpseverino Jun 16, 2025
8f06719
Make the linter happy
fpseverino Jun 16, 2025
67074c0
Update CMakeLists and use FoundationEssentials
fpseverino Jun 17, 2025
83a1500
Replace all Foundation imports with FoundationEssentials (#363)
Lukasa Jun 18, 2025
1eb3eec
Catch the WWDC-25 branch up to the tip of main (#365)
Lukasa Jun 18, 2025
2c12b1b
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Jun 18, 2025
794dfa6
Update DocC
fpseverino Jun 19, 2025
8be1081
Perform another catch-up merge for the WWDC 2025 branch (#367)
Lukasa Jun 20, 2025
8e57f3e
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Jun 20, 2025
9b06971
Adopt Swift 6 mode (#368)
Lukasa Jun 23, 2025
28350a9
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Jun 23, 2025
63d96f1
Remove some warnings
fpseverino Jun 24, 2025
0434231
Format and remove warnings from MLKEM.swift
fpseverino Jun 24, 2025
66b1202
Remove `signature:` parameter label from `isValidSignature`
fpseverino Aug 6, 2025
d9f3641
[WWDC25] Add SHA-3 implementation backed by XKCP (#397)
simonjbeaumont Aug 11, 2025
478a430
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Aug 18, 2025
890595d
Catch-up merge main into wwdc25 branch (#403)
Lukasa Sep 9, 2025
8ba4cb8
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Sep 9, 2025
ea7f8fb
Update to RC SDK (#410)
Lukasa Sep 10, 2025
5247e53
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Sep 10, 2025
d9638b0
Fix conflicts
fpseverino Sep 10, 2025
4a6a254
Remove unreleated stuff
fpseverino Sep 10, 2025
f9fa563
Fix conflicts
fpseverino Sep 10, 2025
1d62dfa
Move external mu methods to separate file
fpseverino Sep 12, 2025
47da0e2
Formatting
fpseverino Sep 12, 2025
3a8c300
Update CMakeLists.txt
fpseverino Sep 12, 2025
4e662b8
Rename _CryptoExtras Take 2 (#407)
0xTim Sep 15, 2025
d5fce84
Merge remote-tracking branch 'upstream/wwdc-25' into mldsa-external-mu
fpseverino Sep 15, 2025
46d7ce0
Move external mu files to new CryptoExtras module
fpseverino Sep 15, 2025
8ec37c7
Update `withUnsafeBytes` to `package` access level
fpseverino Sep 15, 2025
a34d9fb
Formatting
fpseverino Sep 15, 2025
2febca7
Update for macOS 26
fpseverino Sep 16, 2025
788c399
Make external mu work when `let development = false`
fpseverino Sep 16, 2025
981d583
Move MLDSA implementation to CryptoBoringWrapper
fpseverino Sep 16, 2025
97f7ce6
Update CMakeLists
fpseverino Sep 16, 2025
1d82983
Remove flag checks in CryptoBoringWrapper
fpseverino Sep 17, 2025
459adb9
Fix compiler guard for SHA-3 tests (#401)
simonjbeaumont Sep 22, 2025
e0883b4
Final catchup merge (#415)
Lukasa Sep 24, 2025
fc2e934
Merge branch 'wwdc-25' into mldsa-external-mu
fpseverino Sep 29, 2025
7bc3dcc
Merge branch 'main' into mldsa-external-mu
fpseverino Sep 29, 2025
6ebab68
Remove `MLDSA_boring.swift`
fpseverino Sep 29, 2025
d35c528
Merge branch 'main' into mldsa-external-mu
fpseverino Oct 8, 2025
ccde93d
Remove old `Optional+withUnsafeBytes`
fpseverino Oct 8, 2025
e754aae
Update CMakeLists
fpseverino Oct 23, 2025
0587ac3
Merge branch 'main' into mldsa-external-mu
fpseverino Oct 23, 2025
be80d9e
Merge branch 'main' into mldsa-external-mu
fpseverino Oct 23, 2025
8593f02
Merge branch 'main' into mldsa-external-mu
fpseverino Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .swiftformatignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Sources/Crypto/Digests/Digest.swift
Sources/Crypto/Digests/Digests.swift
Sources/Crypto/Digests/HashFunctions.swift
Sources/Crypto/Digests/HashFunctions_SHA2.swift
Sources/Crypto/Digests/HashFunctions_SHA3.swift
Sources/Crypto/HPKE/Ciphersuite/HPKE-AEAD.swift
Sources/Crypto/HPKE/Ciphersuite/HPKE-Ciphersuite.swift
Sources/Crypto/HPKE/Ciphersuite/HPKE-KDF.swift
Expand All @@ -43,8 +44,12 @@ Sources/Crypto/HPKE/Modes/HPKE-Modes.swift
Sources/Crypto/Insecure/Insecure.swift
Sources/Crypto/Insecure/Insecure_HashFunctions.swift
Sources/Crypto/KEM/KEM.swift
Sources/Crypto/KEM/KEM-Errors.swift
Sources/Crypto/KEM/MLKEM.swift
Sources/Crypto/KEM/XWing.swift
Sources/Crypto/Key Agreement/DH.swift
Sources/Crypto/Key Agreement/ECDH.swift
Sources/Crypto/Key Derivation/ANSIx963.swift
Sources/Crypto/Key Derivation/HKDF.swift
Sources/Crypto/Key Wrapping/AESWrap.swift
Sources/Crypto/Keys/EC/Curve25519.swift
Expand All @@ -58,6 +63,7 @@ Sources/Crypto/Message Authentication Codes/MessageAuthenticationCode.swift
Sources/Crypto/PRF/AES.swift
Sources/Crypto/Signatures/ECDSA.swift
Sources/Crypto/Signatures/Ed25519.swift
Sources/Crypto/Signatures/MLDSA.swift
Sources/Crypto/Signatures/Signature.swift
Sources/Crypto/Util/PrettyBytes.swift
Sources/Crypto/Util/SafeCompare.swift
Expand Down Expand Up @@ -116,6 +122,9 @@ Tests/CryptoTests/Encodings/DERTests.swift
Tests/CryptoTests/Encodings/ECKeyEncodingsTests.swift
Tests/CryptoTests/HPKE/HPKETests-TestVectors.swift
Tests/CryptoTests/HPKE/HPKETests.swift
Tests/CryptoTests/KEM/MLKEMKeyGenTests.swift
Tests/CryptoTests/KEM/MLKEMTests.swift
Tests/CryptoTests/KEM/XWingTests.swift
Tests/CryptoTests/Key Derivation/ECprivateKeysFromSeeds.swift
Tests/CryptoTests/Key Derivation/HKDFTests.swift
Tests/CryptoTests/Key Derivation/SharedSecretTests.swift
Expand All @@ -126,6 +135,8 @@ Tests/CryptoTests/SecureBytes/SecureBytesTests.swift
Tests/CryptoTests/Signatures/ECDSA/ECDSASignatureTests.swift
Tests/CryptoTests/Signatures/ECDSA/RawECDSASignaturesTests.swift
Tests/CryptoTests/Signatures/EdDSA/Ed25519-Runner.swift
Tests/CryptoTests/Signatures/MLDSA/MLDSAKeyGenTests.swift
Tests/CryptoTests/Signatures/MLDSA/MLDSATests.swift
Tests/CryptoTests/Utils/PrettyBytes.swift
Tests/CryptoTests/Utils/RFCVector.swift
Tests/CryptoTests/Utils/SplitData.swift
Expand Down
7 changes: 6 additions & 1 deletion Benchmarks/Benchmarks/Benchmarks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
//===----------------------------------------------------------------------===//
import Benchmark
import Crypto
import Foundation
import _CryptoExtras

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

let benchmarks = {
let defaultMetrics: [BenchmarkMetric] = [.mallocCountTotal, .cpuTotal]

Expand Down
9 changes: 8 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,14 @@ let package = Package(
name: "CryptoTests",
dependencies: ["Crypto"],
resources: [
.copy("HPKE/hpke-test-vectors.json")
.copy("HPKE/hpke-test-vectors.json"),
.copy("KEM/MLKEM768_BSSLKAT.json"),
.copy("KEM/MLKEM768KAT.json"),
.copy("KEM/MLKEM1024_BSSLKAT.json"),
.copy("KEM/MLKEM1024KAT.json"),
.copy("KEM/test-vectors.json"),
.copy("Signatures/MLDSA/MLDSA65_KeyGen_KAT.json"),
.copy("Signatures/MLDSA/MLDSA87_KeyGen_KAT.json"),
],
swiftSettings: swiftSettings
),
Expand Down
2 changes: 2 additions & 0 deletions Sources/CCryptoBoringSSL/include/CCryptoBoringSSL.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "CCryptoBoringSSL_cmac.h"
#include "CCryptoBoringSSL_conf.h"
#include "CCryptoBoringSSL_cpu.h"
#include "CCryptoBoringSSL_ctrdrbg.h"
#include "CCryptoBoringSSL_curve25519.h"
#include "CCryptoBoringSSL_des.h"
#include "CCryptoBoringSSL_e_os2.h"
Expand Down Expand Up @@ -62,5 +63,6 @@
#include "CCryptoBoringSSL_siphash.h"
#include "CCryptoBoringSSL_trust_token.h"
#include "CCryptoBoringSSL_x509v3.h"
#include "CCryptoBoringSSL_xwing.h"

#endif // C_CRYPTO_BORINGSSL_H
39 changes: 25 additions & 14 deletions Sources/Crypto/AEADs/AES/GCM/AES-GCM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,30 @@
#if CRYPTO_IN_SWIFTPM && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
@_exported import CryptoKit
#else
#if !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
#if (!CRYPTO_IN_SWIFTPM_FORCE_BUILD_API) || CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias AESGCMImpl = CoreCryptoGCMImpl
import Security
#else
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias AESGCMImpl = OpenSSLAESGCMImpl
#endif

import Foundation
#if CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
public import SwiftSystem
#else
#if canImport(FoundationEssentials)
public import FoundationEssentials
#else
public import Foundation
#endif
#endif

@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
extension AES {
/// The Advanced Encryption Standard (AES) Galois Counter Mode (GCM) cipher
/// suite.
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
public enum GCM: Cipher {
public enum GCM: Cipher, Sendable {
static let tagByteCount = 16
static let defaultNonceByteCount = 12

Expand All @@ -41,12 +48,12 @@ extension AES {
/// - Parameters:
/// - message: The plaintext data to seal.
/// - key: A cryptographic key used to seal the message.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``AES.GCM.Nonce()``.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``AES/GCM/Nonce/init()``.
/// - authenticatedData: Additional data to be authenticated.
///
/// - Returns: The sealed message.
public static func seal<Plaintext: DataProtocol, AuthenticatedData: DataProtocol>
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil, authenticating authenticatedData: AuthenticatedData) throws -> SealedBox {
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil, authenticating authenticatedData: AuthenticatedData) throws(CryptoKitMetaError) -> SealedBox {
return try AESGCMImpl.seal(key: key, message: message, nonce: nonce, authenticatedData: authenticatedData)
}

Expand All @@ -56,11 +63,11 @@ extension AES {
/// - Parameters:
/// - message: The plaintext data to seal.
/// - key: A cryptographic key used to seal the message.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``AES.GCM.Nonce()``.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``AES/GCM/Nonce/init()``.
///
/// - Returns: The sealed message.
public static func seal<Plaintext: DataProtocol>
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil) throws -> SealedBox {
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce? = nil) throws(CryptoKitMetaError) -> SealedBox {
return try AESGCMImpl.seal(key: key, message: message, nonce: nonce, authenticatedData: Data?.none)
}

Expand All @@ -76,7 +83,7 @@ extension AES {
/// box, as long as the correct key is used and authentication succeeds.
/// The call throws an error if decryption or authentication fail.
public static func open<AuthenticatedData: DataProtocol>
(_ sealedBox: SealedBox, using key: SymmetricKey, authenticating authenticatedData: AuthenticatedData) throws -> Data {
(_ sealedBox: SealedBox, using key: SymmetricKey, authenticating authenticatedData: AuthenticatedData) throws(CryptoKitMetaError) -> Data {
return try AESGCMImpl.open(key: key, sealedBox: sealedBox, authenticatedData: authenticatedData)
}

Expand All @@ -89,7 +96,7 @@ extension AES {
/// - Returns: The original plaintext message that was sealed in the
/// box, as long as the correct key is used and authentication succeeds.
/// The call throws an error if decryption or authentication fail.
public static func open(_ sealedBox: SealedBox, using key: SymmetricKey) throws -> Data {
public static func open(_ sealedBox: SealedBox, using key: SymmetricKey) throws(CryptoKitMetaError) -> Data {
return try AESGCMImpl.open(key: key, sealedBox: sealedBox, authenticatedData: Data?.none)
}
}
Expand All @@ -112,7 +119,7 @@ extension AES.GCM {
/// The receiver uses another instance of the same cipher, like the
/// ``open(_:using:)`` method, to open the box.
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
public struct SealedBox: AEADSealedBox {
public struct SealedBox: AEADSealedBox, Sendable {
private let combinedRepresentation: Data
private let nonceByteCount: Int

Expand Down Expand Up @@ -167,13 +174,17 @@ extension AES.GCM {
/// - combined: The combined bytes of the nonce, encrypted data, and
/// authentication tag.
@inlinable
public init<D: DataProtocol>(combined: D) throws {
public init<D: DataProtocol>(combined: D) throws(CryptoKitMetaError) {
// AES minimum nonce (12 bytes) + AES tag (16 bytes)
// While we have these values in the internal APIs, we can't use it in inlinable code.
let aesGCMOverhead = 12 + 16

if combined.count < aesGCMOverhead {
#if hasFeature(Embedded)
throw CryptoKitMetaError.cryptoKitError(underlyingError: CryptoKitError.incorrectParameterSize)
#else
throw CryptoKitError.incorrectParameterSize
#endif
}

self.init(combined: Data(combined))
Expand All @@ -185,9 +196,9 @@ extension AES.GCM {
/// - nonce: The nonce.
/// - ciphertext: The encrypted data.
/// - tag: The authentication tag.
public init<C: DataProtocol, T: DataProtocol>(nonce: AES.GCM.Nonce, ciphertext: C, tag: T) throws {
public init<C: DataProtocol, T: DataProtocol>(nonce: AES.GCM.Nonce, ciphertext: C, tag: T) throws(CryptoKitMetaError) {
guard tag.count == AES.GCM.tagByteCount else {
throw CryptoKitError.incorrectParameterSize
throw error(CryptoKitError.incorrectParameterSize)
}

let nonceByteCount = nonce.bytes.count
Expand Down
4 changes: 4 additions & 0 deletions Sources/Crypto/AEADs/AES/GCM/BoringSSL/AES-GCM_boring.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#else
@_implementationOnly import CCryptoBoringSSL
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
enum OpenSSLAESGCMImpl {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
@_implementationOnly import CCryptoBoringSSL
@_implementationOnly import CCryptoBoringSSLShims
import CryptoBoringWrapper
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif

@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
extension BoringSSLAEAD {
Expand Down
22 changes: 15 additions & 7 deletions Sources/Crypto/AEADs/ChachaPoly/ChaChaPoly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,28 @@
#if CRYPTO_IN_SWIFTPM && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
@_exported import CryptoKit
#else
#if !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
#if (!CRYPTO_IN_SWIFTPM_FORCE_BUILD_API) || CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias ChaChaPolyImpl = CoreCryptoChaChaPolyImpl
import Security
#else
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
typealias ChaChaPolyImpl = OpenSSLChaChaPolyImpl
#endif

import Foundation
#if CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
public import SwiftSystem
#else
#if canImport(FoundationEssentials)
public import FoundationEssentials
#else
public import Foundation
#endif
#endif


/// An implementation of the ChaCha20-Poly1305 cipher.
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
public enum ChaChaPoly: Cipher {
public enum ChaChaPoly: Cipher, Sendable {
static let tagByteCount = 16
static let keyBitsCount = 256
static let nonceByteCount = 12
Expand All @@ -39,7 +47,7 @@ public enum ChaChaPoly: Cipher {
/// - Parameters:
/// - message: The plaintext data to seal.
/// - key: A cryptographic key used to seal the message.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``ChaChaPoly.Nonce()``.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``ChaChaPoly/Nonce/init()``.
/// - authenticatedData: Additional data to be authenticated.
///
/// - Returns: The sealed message.
Expand All @@ -54,7 +62,7 @@ public enum ChaChaPoly: Cipher {
/// - Parameters:
/// - message: The plaintext data to seal.
/// - key: A cryptographic key used to seal the message.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``ChaChaPoly.Nonce()``.
/// - nonce: The nonce the sealing process requires. If you don't provide a nonce, the method generates a random one by invoking ``ChaChaPoly/Nonce/init()``.
///
/// - Returns: The sealed message.
public static func seal<Plaintext: DataProtocol>
Expand Down Expand Up @@ -111,7 +119,7 @@ extension ChaChaPoly {
/// ``open(_:using:)`` method, to open the box.
@frozen
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
public struct SealedBox: AEADSealedBox {
public struct SealedBox: AEADSealedBox, Sendable {
/// A combined element composed of the tag, the nonce, and the
/// ciphertext.
///
Expand Down
16 changes: 13 additions & 3 deletions Sources/Crypto/AEADs/Cipher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@
#if CRYPTO_IN_SWIFTPM && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
@_exported import CryptoKit
#else

#if CRYPTOKIT_NO_ACCESS_TO_FOUNDATION
import SwiftSystem
#else
#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
#endif


@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
protocol AEADSealedBox {
protocol AEADSealedBox: Sendable {
associatedtype Nonce: Sequence
/// The authentication tag
var tag: Data { get }
Expand Down Expand Up @@ -52,7 +62,7 @@ protocol Cipher {
/// - Returns: The sealed box containing the ciphertext and authentication tag
/// - Throws: An error occurred while encrypting or authenticating.
static func seal<Plaintext: DataProtocol, AuthenticatedData: DataProtocol>
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce?, authenticating: AuthenticatedData) throws -> SealedBox
(_ message: Plaintext, using key: SymmetricKey, nonce: Nonce?, authenticating: AuthenticatedData) throws(CryptoKitMetaError) -> SealedBox

/// Opens the sealed box. This decrypts and verifies the authenticity of the message,
/// and optionally verifies the authenticity of the authenticated data.
Expand All @@ -65,6 +75,6 @@ protocol Cipher {
/// - Returns: Returns the data, if the correct key is used and the authenticated data matches the one from the seal operation.
/// - Throws: An error occurred while decrypting or authenticating.
static func open<AuthenticatedData: DataProtocol>
(_ sealedBox: SealedBox, using key: Key, authenticating: AuthenticatedData) throws -> Data
(_ sealedBox: SealedBox, using key: Key, authenticating: AuthenticatedData) throws(CryptoKitMetaError) -> Data
}
#endif
Loading