Skip to content

Commit 431013a

Browse files
LukasaYourMJKsimonjbeaumontrnrojosephnoir
authored
Update to WWDC25 release (#417)
This change updates Crypto to WWDC25 equivalent code. Each of these changes were individually merged to the WWDC25 branch. This includes: - #359 - #363 - #365 - #367 - #368 - #397 - #403 - #410 - #407 - #401 - #415 --------- Co-authored-by: YourMJK <[email protected]> Co-authored-by: Si Beaumont <[email protected]> Co-authored-by: Rick Newton-Rogers <[email protected]> Co-authored-by: Raphael <[email protected]> Co-authored-by: Evan Wilde <[email protected]> Co-authored-by: Tim Condon <[email protected]> Co-authored-by: Gus Cairo <[email protected]> Co-authored-by: George Barnett <[email protected]> Co-authored-by: Fabrice de Gans <[email protected]> Co-authored-by: Wojciech Nagrodzki <[email protected]> Co-authored-by: Jesse L. Zamora <[email protected]> Co-authored-by: aryan-25 <[email protected]> Co-authored-by: Gwynne Raskind <[email protected]> Co-authored-by: 3405691582 <[email protected]> Co-authored-by: Paul Toffoloni <[email protected]>
1 parent 95ba031 commit 431013a

File tree

322 files changed

+17926
-1746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+17926
-1746
lines changed

.github/workflows/pull_request.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
{ "name": "CCryptoBoringSSL", "type": "source", "exceptions": [] },
5858
{ "name": "CCryptoBoringSSLShims", "type": "source", "exceptions": [] },
5959
{ "name": "CryptoBoringWrapper", "type": "source", "exceptions": [] },
60+
{ "name": "CXKCP", "type": "source", "exceptions": [] },
61+
{ "name": "CXKCPShims", "type": "source", "exceptions": [] },
6062
{ "name": "Crypto", "type": "source", "exceptions": [] },
61-
{ "name": "_CryptoExtras", "type": "source", "exceptions": [] },
63+
{ "name": "CryptoExtras", "type": "source", "exceptions": [] },
6264
{ "name": "CCryptoBoringSSL", "type": "assembly", "exceptions": [ "*/AES/*.swift" ] }
6365
]
6466
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DS_Store
2-
/.build
2+
.build
33
/out
44
/Packages
55
/*.xcodeproj
@@ -12,6 +12,7 @@ Package.resolved
1212
DerivedData
1313
.swiftpm
1414
**/gyb.pyc
15+
scripts/__pycache__/
1516

1617
.*.sw[nop]
1718

.licenseignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ dev/update-benchmark-thresholds
4343
**/*.der
4444
.swiftformat
4545
Sources/CCryptoBoringSSL/*
46+
Sources/CXKCP/*
4647
**/*.swift.gyb
4748
scripts/*.patch
4849
scripts/gyb

.spi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: 1
22
builder:
33
configs:
4-
- documentation_targets: [Crypto, _CryptoExtras]
4+
- documentation_targets: [Crypto, CryptoExtras]
55
platform: linux

.swiftformatignore

Lines changed: 79 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Sources/Crypto/Digests/Digest.swift
2525
Sources/Crypto/Digests/Digests.swift
2626
Sources/Crypto/Digests/HashFunctions.swift
2727
Sources/Crypto/Digests/HashFunctions_SHA2.swift
28+
Sources/Crypto/Digests/HashFunctions_SHA3.swift
2829
Sources/Crypto/HPKE/Ciphersuite/HPKE-AEAD.swift
2930
Sources/Crypto/HPKE/Ciphersuite/HPKE-Ciphersuite.swift
3031
Sources/Crypto/HPKE/Ciphersuite/HPKE-KDF.swift
@@ -43,8 +44,12 @@ Sources/Crypto/HPKE/Modes/HPKE-Modes.swift
4344
Sources/Crypto/Insecure/Insecure.swift
4445
Sources/Crypto/Insecure/Insecure_HashFunctions.swift
4546
Sources/Crypto/KEM/KEM.swift
47+
Sources/Crypto/KEM/KEM-Errors.swift
48+
Sources/Crypto/KEM/MLKEM.swift
49+
Sources/Crypto/KEM/XWing.swift
4650
Sources/Crypto/Key Agreement/DH.swift
4751
Sources/Crypto/Key Agreement/ECDH.swift
52+
Sources/Crypto/Key Derivation/ANSIx963.swift
4853
Sources/Crypto/Key Derivation/HKDF.swift
4954
Sources/Crypto/Key Wrapping/AESWrap.swift
5055
Sources/Crypto/Keys/EC/Curve25519.swift
@@ -58,51 +63,52 @@ Sources/Crypto/Message Authentication Codes/MessageAuthenticationCode.swift
5863
Sources/Crypto/PRF/AES.swift
5964
Sources/Crypto/Signatures/ECDSA.swift
6065
Sources/Crypto/Signatures/Ed25519.swift
66+
Sources/Crypto/Signatures/MLDSA.swift
6167
Sources/Crypto/Signatures/Signature.swift
6268
Sources/Crypto/Util/PrettyBytes.swift
6369
Sources/Crypto/Util/SafeCompare.swift
6470
Sources/Crypto/Util/SecureBytes.swift
6571
Sources/Crypto/Util/Zeroization.swift
66-
Sources/_CryptoExtras/AES/AES_CBC.swift
67-
Sources/_CryptoExtras/AES/AES_CFB.swift
68-
Sources/_CryptoExtras/AES/AES_CTR.swift
69-
Sources/_CryptoExtras/AES/AES_GCM_SIV.swift
70-
Sources/_CryptoExtras/AES/Block Function.swift
71-
Sources/_CryptoExtras/ARC/ARC+API.swift
72-
Sources/_CryptoExtras/ARC/ARC.swift
73-
Sources/_CryptoExtras/ARC/ARCCredential.swift
74-
Sources/_CryptoExtras/ARC/ARCEncoding.swift
75-
Sources/_CryptoExtras/ARC/ARCPrecredential.swift
76-
Sources/_CryptoExtras/ARC/ARCPresentation.swift
77-
Sources/_CryptoExtras/ARC/ARCRequest.swift
78-
Sources/_CryptoExtras/ARC/ARCResponse.swift
79-
Sources/_CryptoExtras/ARC/ARCServer.swift
80-
Sources/_CryptoExtras/ZKPs/Prover.swift
81-
Sources/_CryptoExtras/ZKPs/Verifier.swift
82-
Sources/_CryptoExtras/ZKPs/ZKPToolbox.swift
83-
Sources/_CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift
84-
Sources/_CryptoExtras/ECToolbox/ECToolbox.swift
85-
Sources/_CryptoExtras/H2G/HashToField.swift
86-
Sources/_CryptoExtras/Key Derivation/KDF.swift
87-
Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift
88-
Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift
89-
Sources/_CryptoExtras/OPRFs/OPRF.swift
90-
Sources/_CryptoExtras/OPRFs/OPRFClient.swift
91-
Sources/_CryptoExtras/OPRFs/OPRFServer.swift
92-
Sources/_CryptoExtras/OPRFs/VOPRF+API.swift
93-
Sources/_CryptoExtras/OPRFs/VOPRFClient.swift
94-
Sources/_CryptoExtras/OPRFs/VOPRFServer.swift
95-
Sources/_CryptoExtras/RSA/RSA+BlindSigning.swift
96-
Sources/_CryptoExtras/RSA/RSA.swift
97-
Sources/_CryptoExtras/Util/BoringSSLHelpers.swift
98-
Sources/_CryptoExtras/Util/DigestType.swift
99-
Sources/_CryptoExtras/Util/Error.swift
100-
Sources/_CryptoExtras/Util/I2OSP.swift
101-
Sources/_CryptoExtras/Util/IntegerEncoding.swift
102-
Sources/_CryptoExtras/Util/PEMDocument.swift
103-
Sources/_CryptoExtras/Util/PrettyBytes.swift
104-
Sources/_CryptoExtras/Util/SubjectPublicKeyInfo.swift
105-
Sources/_CryptoExtras/ZKPs/DLEQ.swift
72+
Sources/CryptoExtras/AES/AES_CBC.swift
73+
Sources/CryptoExtras/AES/AES_CFB.swift
74+
Sources/CryptoExtras/AES/AES_CTR.swift
75+
Sources/CryptoExtras/AES/AES_GCM_SIV.swift
76+
Sources/CryptoExtras/AES/Block Function.swift
77+
Sources/CryptoExtras/ARC/ARC+API.swift
78+
Sources/CryptoExtras/ARC/ARC.swift
79+
Sources/CryptoExtras/ARC/ARCCredential.swift
80+
Sources/CryptoExtras/ARC/ARCEncoding.swift
81+
Sources/CryptoExtras/ARC/ARCPrecredential.swift
82+
Sources/CryptoExtras/ARC/ARCPresentation.swift
83+
Sources/CryptoExtras/ARC/ARCRequest.swift
84+
Sources/CryptoExtras/ARC/ARCResponse.swift
85+
Sources/CryptoExtras/ARC/ARCServer.swift
86+
Sources/CryptoExtras/ZKPs/Prover.swift
87+
Sources/CryptoExtras/ZKPs/Verifier.swift
88+
Sources/CryptoExtras/ZKPs/ZKPToolbox.swift
89+
Sources/CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift
90+
Sources/CryptoExtras/ECToolbox/ECToolbox.swift
91+
Sources/CryptoExtras/H2G/HashToField.swift
92+
Sources/CryptoExtras/Key Derivation/KDF.swift
93+
Sources/CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift
94+
Sources/CryptoExtras/Key Derivation/Scrypt/Scrypt.swift
95+
Sources/CryptoExtras/OPRFs/OPRF.swift
96+
Sources/CryptoExtras/OPRFs/OPRFClient.swift
97+
Sources/CryptoExtras/OPRFs/OPRFServer.swift
98+
Sources/CryptoExtras/OPRFs/VOPRF+API.swift
99+
Sources/CryptoExtras/OPRFs/VOPRFClient.swift
100+
Sources/CryptoExtras/OPRFs/VOPRFServer.swift
101+
Sources/CryptoExtras/RSA/RSA+BlindSigning.swift
102+
Sources/CryptoExtras/RSA/RSA.swift
103+
Sources/CryptoExtras/Util/BoringSSLHelpers.swift
104+
Sources/CryptoExtras/Util/DigestType.swift
105+
Sources/CryptoExtras/Util/Error.swift
106+
Sources/CryptoExtras/Util/I2OSP.swift
107+
Sources/CryptoExtras/Util/IntegerEncoding.swift
108+
Sources/CryptoExtras/Util/PEMDocument.swift
109+
Sources/CryptoExtras/Util/PrettyBytes.swift
110+
Sources/CryptoExtras/Util/SubjectPublicKeyInfo.swift
111+
Sources/CryptoExtras/ZKPs/DLEQ.swift
106112
Sources/crypto-shasum/main.swift
107113
Tests/CryptoTests/ASN1/ASN1Tests.swift
108114
Tests/CryptoTests/ASN1/GeneralizedTimeTests.swift
@@ -115,6 +121,9 @@ Tests/CryptoTests/Encodings/DERTests.swift
115121
Tests/CryptoTests/Encodings/ECKeyEncodingsTests.swift
116122
Tests/CryptoTests/HPKE/HPKETests-TestVectors.swift
117123
Tests/CryptoTests/HPKE/HPKETests.swift
124+
Tests/CryptoTests/KEM/MLKEMKeyGenTests.swift
125+
Tests/CryptoTests/KEM/MLKEMTests.swift
126+
Tests/CryptoTests/KEM/XWingTests.swift
118127
Tests/CryptoTests/Key Derivation/ECprivateKeysFromSeeds.swift
119128
Tests/CryptoTests/Key Derivation/HKDFTests.swift
120129
Tests/CryptoTests/Key Derivation/SharedSecretTests.swift
@@ -125,36 +134,38 @@ Tests/CryptoTests/SecureBytes/SecureBytesTests.swift
125134
Tests/CryptoTests/Signatures/ECDSA/ECDSASignatureTests.swift
126135
Tests/CryptoTests/Signatures/ECDSA/RawECDSASignaturesTests.swift
127136
Tests/CryptoTests/Signatures/EdDSA/Ed25519-Runner.swift
137+
Tests/CryptoTests/Signatures/MLDSA/MLDSAKeyGenTests.swift
138+
Tests/CryptoTests/Signatures/MLDSA/MLDSATests.swift
128139
Tests/CryptoTests/Utils/PrettyBytes.swift
129140
Tests/CryptoTests/Utils/RFCVector.swift
130141
Tests/CryptoTests/Utils/SplitData.swift
131142
Tests/CryptoTests/Utils/Wycheproof.swift
132143
Tests/CryptoTests/Utils/XCTestUtils.swift
133-
Tests/_CryptoExtrasTests/AES Block Function Tests.swift
134-
Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift
135-
Tests/_CryptoExtrasTests/AES_CBCTests.swift
136-
Tests/_CryptoExtrasTests/AES_CFBTests.swift
137-
Tests/_CryptoExtrasTests/AES_CTRTests.swift
138-
Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift
139-
Tests/_CryptoExtrasTests/ARC/ARCEncodingTests.swift
140-
Tests/_CryptoExtrasTests/ARC/ARCPublicAPITests.swift
141-
Tests/_CryptoExtrasTests/ARC/ARCTestVectors.swift
142-
Tests/_CryptoExtrasTests/ARC/ARCTests.swift
143-
Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift
144-
Tests/_CryptoExtrasTests/ECToolbox/HashToCurveTests.swift
145-
Tests/_CryptoExtrasTests/OPRFs/ECVOPRFTests.swift
146-
Tests/_CryptoExtrasTests/OPRFs/VOPRFAPITests.swift
147-
Tests/_CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift
148-
Tests/_CryptoExtrasTests/PBKDF2Tests.swift
149-
Tests/_CryptoExtrasTests/ScryptTests.swift
150-
Tests/_CryptoExtrasTests/TestRSABlindSigning.swift
151-
Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift
152-
Tests/_CryptoExtrasTests/TestRSAEncryption.swift
153-
Tests/_CryptoExtrasTests/TestRSASigning.swift
154-
Tests/_CryptoExtrasTests/Util/IntegerEncodingTests.swift
155-
Tests/_CryptoExtrasTests/Utils/BytesUtil.swift
156-
Tests/_CryptoExtrasTests/Utils/RFCVector.swift
157-
Tests/_CryptoExtrasTests/Utils/SplitData.swift
158-
Tests/_CryptoExtrasTests/Utils/Wycheproof.swift
159-
Tests/_CryptoExtrasTests/Utils/XCTestUtils.swift
160-
Tests/_CryptoExtrasTests/ZKPs/ZKPToolbox.swift
144+
Tests/CryptoExtrasTests/AES Block Function Tests.swift
145+
Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift
146+
Tests/CryptoExtrasTests/AES_CBCTests.swift
147+
Tests/CryptoExtrasTests/AES_CFBTests.swift
148+
Tests/CryptoExtrasTests/AES_CTRTests.swift
149+
Tests/CryptoExtrasTests/ARC/ARCAPITests.swift
150+
Tests/CryptoExtrasTests/ARC/ARCEncodingTests.swift
151+
Tests/CryptoExtrasTests/ARC/ARCPublicAPITests.swift
152+
Tests/CryptoExtrasTests/ARC/ARCTestVectors.swift
153+
Tests/CryptoExtrasTests/ARC/ARCTests.swift
154+
Tests/CryptoExtrasTests/ChaCha20CTRTests.swift
155+
Tests/CryptoExtrasTests/ECToolbox/HashToCurveTests.swift
156+
Tests/CryptoExtrasTests/OPRFs/ECVOPRFTests.swift
157+
Tests/CryptoExtrasTests/OPRFs/VOPRFAPITests.swift
158+
Tests/CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift
159+
Tests/CryptoExtrasTests/PBKDF2Tests.swift
160+
Tests/CryptoExtrasTests/ScryptTests.swift
161+
Tests/CryptoExtrasTests/TestRSABlindSigning.swift
162+
Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift
163+
Tests/CryptoExtrasTests/TestRSAEncryption.swift
164+
Tests/CryptoExtrasTests/TestRSASigning.swift
165+
Tests/CryptoExtrasTests/Util/IntegerEncodingTests.swift
166+
Tests/CryptoExtrasTests/Utils/BytesUtil.swift
167+
Tests/CryptoExtrasTests/Utils/RFCVector.swift
168+
Tests/CryptoExtrasTests/Utils/SplitData.swift
169+
Tests/CryptoExtrasTests/Utils/Wycheproof.swift
170+
Tests/CryptoExtrasTests/Utils/XCTestUtils.swift
171+
Tests/CryptoExtrasTests/ZKPs/ZKPToolbox.swift

.unacceptablelanguageignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Sources/CCryptoBoringSSL/*
1+
Sources/CCryptoBoringSSL/*
2+
Sources/CXKCP/*

Benchmarks/Benchmarks/Benchmarks.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@
1313
//===----------------------------------------------------------------------===//
1414
import Benchmark
1515
import Crypto
16+
import CryptoExtras
17+
18+
#if canImport(FoundationEssentials)
19+
import FoundationEssentials
20+
#else
1621
import Foundation
17-
import _CryptoExtras
22+
#endif
1823

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

Benchmarks/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
.product(name: "Benchmark", package: "package-benchmark"),
1616
.product(name: "Crypto", package: "swift-crypto"),
17-
.product(name: "_CryptoExtras", package: "swift-crypto"),
17+
.product(name: "CryptoExtras", package: "swift-crypto"),
1818
],
1919
path: "Benchmarks/",
2020
plugins: [

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ act --container-architecture linux/amd64 pull_request -j cmake-lists -W ./.githu
6969

7070
You can find the underlying script at https://github.com/apple/swift-nio/blob/main/scripts/update-cmake-lists.sh . Using the script directly is less straightforwards because it requires you to pass the JSON config from the `pull_request.yml` file into the script, such as:
7171
```
72-
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/update-cmake-lists.sh | CONFIG_JSON='{"targets":[{"name":"CCryptoBoringSSL","type":"source","exceptions":[]},{"name":"CCryptoBoringSSLShims","type":"source","exceptions":[]},{"name":"CryptoBoringWrapper","type":"source","exceptions":[]},{"name":"Crypto","type":"source","exceptions":[]},{"name":"_CryptoExtras","type":"source","exceptions":[]},{"name":"CCryptoBoringSSL","type":"assembly","exceptions":["*/AES/*.swift"]}]}' bash
72+
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/update-cmake-lists.sh | CONFIG_JSON='{"targets":[{"name":"CCryptoBoringSSL","type":"source","exceptions":[]},{"name":"CCryptoBoringSSLShims","type":"source","exceptions":[]},{"name":"CryptoBoringWrapper","type":"source","exceptions":[]},{"name":"Crypto","type":"source","exceptions":[]},{"name":"CryptoExtras","type":"source","exceptions":[]},{"name":"CCryptoBoringSSL","type":"assembly","exceptions":["*/AES/*.swift"]}]}' bash
7373
```
7474

7575
## API Evolution

0 commit comments

Comments
 (0)