From f890010d8e8fc63c03a7a9bea4a1b5ba14a7bb78 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 18:47:51 +0100 Subject: [PATCH 1/6] Remove the underscore from CryptoExtras --- Package.swift | 7 ++++--- Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CBC.swift | 0 Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CFB.swift | 0 Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CTR.swift | 0 .../{_CryptoExtras => CryptoExtras}/AES/AES_GCM_SIV.swift | 0 .../AES/Block Function.swift | 0 .../AES/BoringSSL/AES_CFB_boring.swift | 0 .../AES/BoringSSL/AES_CTR_boring.swift | 0 .../AES/BoringSSL/AES_GCM_SIV_boring.swift | 0 Sources/{_CryptoExtras => CryptoExtras}/CMakeLists.txt | 0 .../ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift | 0 .../ChaCha20CTR/ChaCha20CTR.swift | 0 .../{_CryptoExtras => CryptoExtras}/PrivacyInfo.xcprivacy | 0 .../RSA/RSA+BlindSigning.swift | 0 Sources/{_CryptoExtras => CryptoExtras}/RSA/RSA.swift | 0 .../{_CryptoExtras => CryptoExtras}/RSA/RSA_boring.swift | 0 .../{_CryptoExtras => CryptoExtras}/RSA/RSA_security.swift | 0 .../Util/BoringSSLHelpers.swift | 0 .../Util/CryptoKitErrors_boring.swift | 0 .../{_CryptoExtras => CryptoExtras}/Util/DigestType.swift | 0 Sources/{_CryptoExtras => CryptoExtras}/Util/Error.swift | 0 .../{_CryptoExtras => CryptoExtras}/Util/PEMDocument.swift | 0 .../{_CryptoExtras => CryptoExtras}/Util/RandomBytes.swift | 0 .../Util/SubjectPublicKeyInfo.swift | 0 .../AES Block Function Tests.swift | 0 .../AES-GCM-SIV-Runner.swift | 0 .../AES_CBCTests.swift | 0 .../AES_CFBTests.swift | 0 .../AES_CTRTests.swift | 0 .../ChaCha20CTRTests.swift | 0 .../TestRSABlindSigning.swift | 0 .../TestRSABlindSigningAPI.swift | 0 .../TestRSAEncryption.swift | 0 .../TestRSASigning.swift | 0 .../Utils/BytesUtil.swift | 0 .../Utils/RFCVector.swift | 0 .../Utils/SplitData.swift | 0 .../Utils/Wycheproof.swift | 0 .../AESCFB128GFSbox128.txt | 0 .../AESCFB128GFSbox192.txt | 0 .../AESCFB128GFSbox256.txt | 0 .../AESCFB128KeySbox128.txt | 0 .../AESCFB128KeySbox192.txt | 0 .../AESCFB128KeySbox256.txt | 0 .../AESCFB128VarKey128.txt | 0 .../AESCFB128VarKey192.txt | 0 .../AESCFB128VarKey256.txt | 0 .../AESCFB128VarTxt128.txt | 0 .../AESCFB128VarTxt192.txt | 0 .../AESCFB128VarTxt256.txt | 0 .../aes_cbc_pkcs5_test.json | 0 .../aes_gcm_siv_test.json | 0 .../rfc9474.json | 0 .../rsa_oaep_2048_sha1_mgf1sha1_test.json | 0 .../rsa_oaep_2048_sha256_mgf1sha256_test.json | 0 .../rsa_oaep_misc_test.json | 0 .../rsa_pss_2048_sha1_mgf1_20_test.json | 0 .../rsa_pss_2048_sha256_mgf1_0_test.json | 0 .../rsa_pss_2048_sha256_mgf1_32_test.json | 0 .../rsa_pss_3072_sha256_mgf1_32_test.json | 0 .../rsa_pss_4096_sha256_mgf1_32_test.json | 0 .../rsa_pss_4096_sha512_mgf1_32_test.json | 0 .../rsa_pss_misc_test.json | 0 .../rsa_signature_2048_sha256_test.json | 0 .../rsa_signature_2048_sha512_test.json | 0 .../rsa_signature_3072_sha256_test.json | 0 .../rsa_signature_3072_sha512_test.json | 0 .../rsa_signature_4096_sha512_test.json | 0 .../rsa_signature_test.json | 0 69 files changed, 4 insertions(+), 3 deletions(-) rename Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CBC.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CFB.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/AES_CTR.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/AES_GCM_SIV.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/Block Function.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/BoringSSL/AES_CFB_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/BoringSSL/AES_CTR_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/AES/BoringSSL/AES_GCM_SIV_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/CMakeLists.txt (100%) rename Sources/{_CryptoExtras => CryptoExtras}/ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/ChaCha20CTR/ChaCha20CTR.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/PrivacyInfo.xcprivacy (100%) rename Sources/{_CryptoExtras => CryptoExtras}/RSA/RSA+BlindSigning.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/RSA/RSA.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/RSA/RSA_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/RSA/RSA_security.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/BoringSSLHelpers.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/CryptoKitErrors_boring.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/DigestType.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/Error.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/PEMDocument.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/RandomBytes.swift (100%) rename Sources/{_CryptoExtras => CryptoExtras}/Util/SubjectPublicKeyInfo.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/AES Block Function Tests.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/AES-GCM-SIV-Runner.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/AES_CBCTests.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/AES_CFBTests.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/AES_CTRTests.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/ChaCha20CTRTests.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/TestRSABlindSigning.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/TestRSABlindSigningAPI.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/TestRSAEncryption.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/TestRSASigning.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/Utils/BytesUtil.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/Utils/RFCVector.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/Utils/SplitData.swift (100%) rename Tests/{_CryptoExtrasTests => CryptoExtrasTests}/Utils/Wycheproof.swift (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128GFSbox128.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128GFSbox192.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128GFSbox256.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128KeySbox128.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128KeySbox192.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128KeySbox256.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarKey128.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarKey192.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarKey256.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarTxt128.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarTxt192.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/AESCFB128VarTxt256.txt (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/aes_cbc_pkcs5_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/aes_gcm_siv_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rfc9474.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_oaep_2048_sha1_mgf1sha1_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_oaep_2048_sha256_mgf1sha256_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_oaep_misc_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_2048_sha1_mgf1_20_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_2048_sha256_mgf1_0_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_2048_sha256_mgf1_32_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_3072_sha256_mgf1_32_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_4096_sha256_mgf1_32_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_4096_sha512_mgf1_32_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_pss_misc_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_2048_sha256_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_2048_sha512_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_3072_sha256_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_3072_sha512_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_4096_sha512_test.json (100%) rename Tests/{_CryptoExtrasVectors => CryptoExtrasVectors}/rsa_signature_test.json (100%) diff --git a/Package.swift b/Package.swift index 12ab2ec8..44a10d3b 100644 --- a/Package.swift +++ b/Package.swift @@ -79,7 +79,8 @@ let package = Package( ], products: [ .library(name: "Crypto", targets: ["Crypto"]), - .library(name: "_CryptoExtras", targets: ["_CryptoExtras"]), + .library(name: "_CryptoExtras", targets: ["CryptoExtras"]), + .library(name: "CryptoExtras", targets: ["CryptoExtras"]), /* This target is used only for symbol mangling. It's added and removed automatically because it emits build warnings. MANGLE_START .library(name: "CCryptoBoringSSL", type: .static, targets: ["CCryptoBoringSSL"]), MANGLE_END */ @@ -138,7 +139,7 @@ let package = Package( swiftSettings: swiftSettings ), .target( - name: "_CryptoExtras", + name: "CryptoExtras", dependencies: [ "CCryptoBoringSSL", "CCryptoBoringSSLShims", @@ -172,7 +173,7 @@ let package = Package( ], swiftSettings: swiftSettings ), - .testTarget(name: "_CryptoExtrasTests", dependencies: ["_CryptoExtras"]), + .testTarget(name: "CryptoExtrasTests", dependencies: ["CryptoExtras"]), .testTarget(name: "CryptoBoringWrapperTests", dependencies: ["CryptoBoringWrapper"]), ], cxxLanguageStandard: .cxx11 diff --git a/Sources/_CryptoExtras/AES/AES_CBC.swift b/Sources/CryptoExtras/AES/AES_CBC.swift similarity index 100% rename from Sources/_CryptoExtras/AES/AES_CBC.swift rename to Sources/CryptoExtras/AES/AES_CBC.swift diff --git a/Sources/_CryptoExtras/AES/AES_CFB.swift b/Sources/CryptoExtras/AES/AES_CFB.swift similarity index 100% rename from Sources/_CryptoExtras/AES/AES_CFB.swift rename to Sources/CryptoExtras/AES/AES_CFB.swift diff --git a/Sources/_CryptoExtras/AES/AES_CTR.swift b/Sources/CryptoExtras/AES/AES_CTR.swift similarity index 100% rename from Sources/_CryptoExtras/AES/AES_CTR.swift rename to Sources/CryptoExtras/AES/AES_CTR.swift diff --git a/Sources/_CryptoExtras/AES/AES_GCM_SIV.swift b/Sources/CryptoExtras/AES/AES_GCM_SIV.swift similarity index 100% rename from Sources/_CryptoExtras/AES/AES_GCM_SIV.swift rename to Sources/CryptoExtras/AES/AES_GCM_SIV.swift diff --git a/Sources/_CryptoExtras/AES/Block Function.swift b/Sources/CryptoExtras/AES/Block Function.swift similarity index 100% rename from Sources/_CryptoExtras/AES/Block Function.swift rename to Sources/CryptoExtras/AES/Block Function.swift diff --git a/Sources/_CryptoExtras/AES/BoringSSL/AES_CFB_boring.swift b/Sources/CryptoExtras/AES/BoringSSL/AES_CFB_boring.swift similarity index 100% rename from Sources/_CryptoExtras/AES/BoringSSL/AES_CFB_boring.swift rename to Sources/CryptoExtras/AES/BoringSSL/AES_CFB_boring.swift diff --git a/Sources/_CryptoExtras/AES/BoringSSL/AES_CTR_boring.swift b/Sources/CryptoExtras/AES/BoringSSL/AES_CTR_boring.swift similarity index 100% rename from Sources/_CryptoExtras/AES/BoringSSL/AES_CTR_boring.swift rename to Sources/CryptoExtras/AES/BoringSSL/AES_CTR_boring.swift diff --git a/Sources/_CryptoExtras/AES/BoringSSL/AES_GCM_SIV_boring.swift b/Sources/CryptoExtras/AES/BoringSSL/AES_GCM_SIV_boring.swift similarity index 100% rename from Sources/_CryptoExtras/AES/BoringSSL/AES_GCM_SIV_boring.swift rename to Sources/CryptoExtras/AES/BoringSSL/AES_GCM_SIV_boring.swift diff --git a/Sources/_CryptoExtras/CMakeLists.txt b/Sources/CryptoExtras/CMakeLists.txt similarity index 100% rename from Sources/_CryptoExtras/CMakeLists.txt rename to Sources/CryptoExtras/CMakeLists.txt diff --git a/Sources/_CryptoExtras/ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift b/Sources/CryptoExtras/ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift similarity index 100% rename from Sources/_CryptoExtras/ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift rename to Sources/CryptoExtras/ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift diff --git a/Sources/_CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift b/Sources/CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift similarity index 100% rename from Sources/_CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift rename to Sources/CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift diff --git a/Sources/_CryptoExtras/PrivacyInfo.xcprivacy b/Sources/CryptoExtras/PrivacyInfo.xcprivacy similarity index 100% rename from Sources/_CryptoExtras/PrivacyInfo.xcprivacy rename to Sources/CryptoExtras/PrivacyInfo.xcprivacy diff --git a/Sources/_CryptoExtras/RSA/RSA+BlindSigning.swift b/Sources/CryptoExtras/RSA/RSA+BlindSigning.swift similarity index 100% rename from Sources/_CryptoExtras/RSA/RSA+BlindSigning.swift rename to Sources/CryptoExtras/RSA/RSA+BlindSigning.swift diff --git a/Sources/_CryptoExtras/RSA/RSA.swift b/Sources/CryptoExtras/RSA/RSA.swift similarity index 100% rename from Sources/_CryptoExtras/RSA/RSA.swift rename to Sources/CryptoExtras/RSA/RSA.swift diff --git a/Sources/_CryptoExtras/RSA/RSA_boring.swift b/Sources/CryptoExtras/RSA/RSA_boring.swift similarity index 100% rename from Sources/_CryptoExtras/RSA/RSA_boring.swift rename to Sources/CryptoExtras/RSA/RSA_boring.swift diff --git a/Sources/_CryptoExtras/RSA/RSA_security.swift b/Sources/CryptoExtras/RSA/RSA_security.swift similarity index 100% rename from Sources/_CryptoExtras/RSA/RSA_security.swift rename to Sources/CryptoExtras/RSA/RSA_security.swift diff --git a/Sources/_CryptoExtras/Util/BoringSSLHelpers.swift b/Sources/CryptoExtras/Util/BoringSSLHelpers.swift similarity index 100% rename from Sources/_CryptoExtras/Util/BoringSSLHelpers.swift rename to Sources/CryptoExtras/Util/BoringSSLHelpers.swift diff --git a/Sources/_CryptoExtras/Util/CryptoKitErrors_boring.swift b/Sources/CryptoExtras/Util/CryptoKitErrors_boring.swift similarity index 100% rename from Sources/_CryptoExtras/Util/CryptoKitErrors_boring.swift rename to Sources/CryptoExtras/Util/CryptoKitErrors_boring.swift diff --git a/Sources/_CryptoExtras/Util/DigestType.swift b/Sources/CryptoExtras/Util/DigestType.swift similarity index 100% rename from Sources/_CryptoExtras/Util/DigestType.swift rename to Sources/CryptoExtras/Util/DigestType.swift diff --git a/Sources/_CryptoExtras/Util/Error.swift b/Sources/CryptoExtras/Util/Error.swift similarity index 100% rename from Sources/_CryptoExtras/Util/Error.swift rename to Sources/CryptoExtras/Util/Error.swift diff --git a/Sources/_CryptoExtras/Util/PEMDocument.swift b/Sources/CryptoExtras/Util/PEMDocument.swift similarity index 100% rename from Sources/_CryptoExtras/Util/PEMDocument.swift rename to Sources/CryptoExtras/Util/PEMDocument.swift diff --git a/Sources/_CryptoExtras/Util/RandomBytes.swift b/Sources/CryptoExtras/Util/RandomBytes.swift similarity index 100% rename from Sources/_CryptoExtras/Util/RandomBytes.swift rename to Sources/CryptoExtras/Util/RandomBytes.swift diff --git a/Sources/_CryptoExtras/Util/SubjectPublicKeyInfo.swift b/Sources/CryptoExtras/Util/SubjectPublicKeyInfo.swift similarity index 100% rename from Sources/_CryptoExtras/Util/SubjectPublicKeyInfo.swift rename to Sources/CryptoExtras/Util/SubjectPublicKeyInfo.swift diff --git a/Tests/_CryptoExtrasTests/AES Block Function Tests.swift b/Tests/CryptoExtrasTests/AES Block Function Tests.swift similarity index 100% rename from Tests/_CryptoExtrasTests/AES Block Function Tests.swift rename to Tests/CryptoExtrasTests/AES Block Function Tests.swift diff --git a/Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift b/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift similarity index 100% rename from Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift rename to Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift diff --git a/Tests/_CryptoExtrasTests/AES_CBCTests.swift b/Tests/CryptoExtrasTests/AES_CBCTests.swift similarity index 100% rename from Tests/_CryptoExtrasTests/AES_CBCTests.swift rename to Tests/CryptoExtrasTests/AES_CBCTests.swift diff --git a/Tests/_CryptoExtrasTests/AES_CFBTests.swift b/Tests/CryptoExtrasTests/AES_CFBTests.swift similarity index 100% rename from Tests/_CryptoExtrasTests/AES_CFBTests.swift rename to Tests/CryptoExtrasTests/AES_CFBTests.swift diff --git a/Tests/_CryptoExtrasTests/AES_CTRTests.swift b/Tests/CryptoExtrasTests/AES_CTRTests.swift similarity index 100% rename from Tests/_CryptoExtrasTests/AES_CTRTests.swift rename to Tests/CryptoExtrasTests/AES_CTRTests.swift diff --git a/Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift b/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift similarity index 100% rename from Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift rename to Tests/CryptoExtrasTests/ChaCha20CTRTests.swift diff --git a/Tests/_CryptoExtrasTests/TestRSABlindSigning.swift b/Tests/CryptoExtrasTests/TestRSABlindSigning.swift similarity index 100% rename from Tests/_CryptoExtrasTests/TestRSABlindSigning.swift rename to Tests/CryptoExtrasTests/TestRSABlindSigning.swift diff --git a/Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift b/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift similarity index 100% rename from Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift rename to Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift diff --git a/Tests/_CryptoExtrasTests/TestRSAEncryption.swift b/Tests/CryptoExtrasTests/TestRSAEncryption.swift similarity index 100% rename from Tests/_CryptoExtrasTests/TestRSAEncryption.swift rename to Tests/CryptoExtrasTests/TestRSAEncryption.swift diff --git a/Tests/_CryptoExtrasTests/TestRSASigning.swift b/Tests/CryptoExtrasTests/TestRSASigning.swift similarity index 100% rename from Tests/_CryptoExtrasTests/TestRSASigning.swift rename to Tests/CryptoExtrasTests/TestRSASigning.swift diff --git a/Tests/_CryptoExtrasTests/Utils/BytesUtil.swift b/Tests/CryptoExtrasTests/Utils/BytesUtil.swift similarity index 100% rename from Tests/_CryptoExtrasTests/Utils/BytesUtil.swift rename to Tests/CryptoExtrasTests/Utils/BytesUtil.swift diff --git a/Tests/_CryptoExtrasTests/Utils/RFCVector.swift b/Tests/CryptoExtrasTests/Utils/RFCVector.swift similarity index 100% rename from Tests/_CryptoExtrasTests/Utils/RFCVector.swift rename to Tests/CryptoExtrasTests/Utils/RFCVector.swift diff --git a/Tests/_CryptoExtrasTests/Utils/SplitData.swift b/Tests/CryptoExtrasTests/Utils/SplitData.swift similarity index 100% rename from Tests/_CryptoExtrasTests/Utils/SplitData.swift rename to Tests/CryptoExtrasTests/Utils/SplitData.swift diff --git a/Tests/_CryptoExtrasTests/Utils/Wycheproof.swift b/Tests/CryptoExtrasTests/Utils/Wycheproof.swift similarity index 100% rename from Tests/_CryptoExtrasTests/Utils/Wycheproof.swift rename to Tests/CryptoExtrasTests/Utils/Wycheproof.swift diff --git a/Tests/_CryptoExtrasVectors/AESCFB128GFSbox128.txt b/Tests/CryptoExtrasVectors/AESCFB128GFSbox128.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128GFSbox128.txt rename to Tests/CryptoExtrasVectors/AESCFB128GFSbox128.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128GFSbox192.txt b/Tests/CryptoExtrasVectors/AESCFB128GFSbox192.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128GFSbox192.txt rename to Tests/CryptoExtrasVectors/AESCFB128GFSbox192.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128GFSbox256.txt b/Tests/CryptoExtrasVectors/AESCFB128GFSbox256.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128GFSbox256.txt rename to Tests/CryptoExtrasVectors/AESCFB128GFSbox256.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128KeySbox128.txt b/Tests/CryptoExtrasVectors/AESCFB128KeySbox128.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128KeySbox128.txt rename to Tests/CryptoExtrasVectors/AESCFB128KeySbox128.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128KeySbox192.txt b/Tests/CryptoExtrasVectors/AESCFB128KeySbox192.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128KeySbox192.txt rename to Tests/CryptoExtrasVectors/AESCFB128KeySbox192.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128KeySbox256.txt b/Tests/CryptoExtrasVectors/AESCFB128KeySbox256.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128KeySbox256.txt rename to Tests/CryptoExtrasVectors/AESCFB128KeySbox256.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarKey128.txt b/Tests/CryptoExtrasVectors/AESCFB128VarKey128.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarKey128.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarKey128.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarKey192.txt b/Tests/CryptoExtrasVectors/AESCFB128VarKey192.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarKey192.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarKey192.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarKey256.txt b/Tests/CryptoExtrasVectors/AESCFB128VarKey256.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarKey256.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarKey256.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarTxt128.txt b/Tests/CryptoExtrasVectors/AESCFB128VarTxt128.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarTxt128.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarTxt128.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarTxt192.txt b/Tests/CryptoExtrasVectors/AESCFB128VarTxt192.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarTxt192.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarTxt192.txt diff --git a/Tests/_CryptoExtrasVectors/AESCFB128VarTxt256.txt b/Tests/CryptoExtrasVectors/AESCFB128VarTxt256.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/AESCFB128VarTxt256.txt rename to Tests/CryptoExtrasVectors/AESCFB128VarTxt256.txt diff --git a/Tests/_CryptoExtrasVectors/aes_cbc_pkcs5_test.json b/Tests/CryptoExtrasVectors/aes_cbc_pkcs5_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/aes_cbc_pkcs5_test.json rename to Tests/CryptoExtrasVectors/aes_cbc_pkcs5_test.json diff --git a/Tests/_CryptoExtrasVectors/aes_gcm_siv_test.json b/Tests/CryptoExtrasVectors/aes_gcm_siv_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/aes_gcm_siv_test.json rename to Tests/CryptoExtrasVectors/aes_gcm_siv_test.json diff --git a/Tests/_CryptoExtrasVectors/rfc9474.json b/Tests/CryptoExtrasVectors/rfc9474.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rfc9474.json rename to Tests/CryptoExtrasVectors/rfc9474.json diff --git a/Tests/_CryptoExtrasVectors/rsa_oaep_2048_sha1_mgf1sha1_test.json b/Tests/CryptoExtrasVectors/rsa_oaep_2048_sha1_mgf1sha1_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_oaep_2048_sha1_mgf1sha1_test.json rename to Tests/CryptoExtrasVectors/rsa_oaep_2048_sha1_mgf1sha1_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_oaep_2048_sha256_mgf1sha256_test.json b/Tests/CryptoExtrasVectors/rsa_oaep_2048_sha256_mgf1sha256_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_oaep_2048_sha256_mgf1sha256_test.json rename to Tests/CryptoExtrasVectors/rsa_oaep_2048_sha256_mgf1sha256_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_oaep_misc_test.json b/Tests/CryptoExtrasVectors/rsa_oaep_misc_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_oaep_misc_test.json rename to Tests/CryptoExtrasVectors/rsa_oaep_misc_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_2048_sha1_mgf1_20_test.json b/Tests/CryptoExtrasVectors/rsa_pss_2048_sha1_mgf1_20_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_2048_sha1_mgf1_20_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_2048_sha1_mgf1_20_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_0_test.json b/Tests/CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_0_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_0_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_0_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_32_test.json b/Tests/CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_32_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_32_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_2048_sha256_mgf1_32_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_3072_sha256_mgf1_32_test.json b/Tests/CryptoExtrasVectors/rsa_pss_3072_sha256_mgf1_32_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_3072_sha256_mgf1_32_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_3072_sha256_mgf1_32_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_4096_sha256_mgf1_32_test.json b/Tests/CryptoExtrasVectors/rsa_pss_4096_sha256_mgf1_32_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_4096_sha256_mgf1_32_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_4096_sha256_mgf1_32_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_4096_sha512_mgf1_32_test.json b/Tests/CryptoExtrasVectors/rsa_pss_4096_sha512_mgf1_32_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_4096_sha512_mgf1_32_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_4096_sha512_mgf1_32_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_pss_misc_test.json b/Tests/CryptoExtrasVectors/rsa_pss_misc_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_pss_misc_test.json rename to Tests/CryptoExtrasVectors/rsa_pss_misc_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_2048_sha256_test.json b/Tests/CryptoExtrasVectors/rsa_signature_2048_sha256_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_2048_sha256_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_2048_sha256_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_2048_sha512_test.json b/Tests/CryptoExtrasVectors/rsa_signature_2048_sha512_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_2048_sha512_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_2048_sha512_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_3072_sha256_test.json b/Tests/CryptoExtrasVectors/rsa_signature_3072_sha256_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_3072_sha256_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_3072_sha256_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_3072_sha512_test.json b/Tests/CryptoExtrasVectors/rsa_signature_3072_sha512_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_3072_sha512_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_3072_sha512_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_4096_sha512_test.json b/Tests/CryptoExtrasVectors/rsa_signature_4096_sha512_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_4096_sha512_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_4096_sha512_test.json diff --git a/Tests/_CryptoExtrasVectors/rsa_signature_test.json b/Tests/CryptoExtrasVectors/rsa_signature_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/rsa_signature_test.json rename to Tests/CryptoExtrasVectors/rsa_signature_test.json From a69de9ed18db4673b15d4eb1ba3444defa276b42 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 18:48:57 +0100 Subject: [PATCH 2/6] Fix the imports --- Tests/CryptoExtrasTests/AES Block Function Tests.swift | 2 +- Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift | 2 +- Tests/CryptoExtrasTests/AES_CBCTests.swift | 2 +- Tests/CryptoExtrasTests/AES_CFBTests.swift | 2 +- Tests/CryptoExtrasTests/AES_CTRTests.swift | 2 +- Tests/CryptoExtrasTests/ChaCha20CTRTests.swift | 2 +- Tests/CryptoExtrasTests/TestRSABlindSigning.swift | 4 ++-- Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift | 2 +- Tests/CryptoExtrasTests/TestRSAEncryption.swift | 2 +- Tests/CryptoExtrasTests/TestRSASigning.swift | 2 +- Tests/CryptoExtrasTests/Utils/RFCVector.swift | 2 +- Tests/CryptoExtrasTests/Utils/Wycheproof.swift | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Tests/CryptoExtrasTests/AES Block Function Tests.swift b/Tests/CryptoExtrasTests/AES Block Function Tests.swift index 776962d4..49819226 100644 --- a/Tests/CryptoExtrasTests/AES Block Function Tests.swift +++ b/Tests/CryptoExtrasTests/AES Block Function Tests.swift @@ -14,7 +14,7 @@ import Foundation import XCTest import Crypto -import _CryptoExtras +import CryptoExtras final class AESBlockFunctionTests: XCTestCase { static let nistPlaintextChunks: [[UInt8]] = [ diff --git a/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift b/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift index 227e73c3..c32ed654 100644 --- a/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift +++ b/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift @@ -14,7 +14,7 @@ import Foundation import XCTest import Crypto -import _CryptoExtras +import CryptoExtras struct AEADTestGroup: Codable { let ivSize: Int diff --git a/Tests/CryptoExtrasTests/AES_CBCTests.swift b/Tests/CryptoExtrasTests/AES_CBCTests.swift index b42131c6..533ca9c2 100644 --- a/Tests/CryptoExtrasTests/AES_CBCTests.swift +++ b/Tests/CryptoExtrasTests/AES_CBCTests.swift @@ -14,7 +14,7 @@ import Crypto import Foundation -import _CryptoExtras +import CryptoExtras import XCTest final class CBCTests: XCTestCase { diff --git a/Tests/CryptoExtrasTests/AES_CFBTests.swift b/Tests/CryptoExtrasTests/AES_CFBTests.swift index 492a4541..14a58d19 100644 --- a/Tests/CryptoExtrasTests/AES_CFBTests.swift +++ b/Tests/CryptoExtrasTests/AES_CFBTests.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest final class AES_CFBTests: XCTestCase { diff --git a/Tests/CryptoExtrasTests/AES_CTRTests.swift b/Tests/CryptoExtrasTests/AES_CTRTests.swift index e154b9b4..477b6e61 100644 --- a/Tests/CryptoExtrasTests/AES_CTRTests.swift +++ b/Tests/CryptoExtrasTests/AES_CTRTests.swift @@ -14,7 +14,7 @@ import Crypto import Foundation -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest final class AESCTRTests: XCTestCase { diff --git a/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift b/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift index b86bfcaa..266c74a9 100644 --- a/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift +++ b/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift @@ -14,7 +14,7 @@ import Foundation import XCTest import Crypto -import _CryptoExtras +import CryptoExtras class ChaCha20CTRTests: XCTestCase { diff --git a/Tests/CryptoExtrasTests/TestRSABlindSigning.swift b/Tests/CryptoExtrasTests/TestRSABlindSigning.swift index fa42b2ee..547cc589 100644 --- a/Tests/CryptoExtrasTests/TestRSABlindSigning.swift +++ b/Tests/CryptoExtrasTests/TestRSABlindSigning.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import XCTest import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras struct RFC9474TestVector: Codable { var name, p, q, n, e, d, msg, msg_prefix, prepared_msg, salt, inv, blinded_msg, blind_sig, sig: String @@ -42,7 +42,7 @@ struct RFC9474TestVector: Codable { } static let allValues: [Self] = try! RFC9474TestVector.load(from: URL( - fileURLWithPath: "../_CryptoExtrasVectors/rfc9474.json", + fileURLWithPath: "../CryptoExtrasVectors/rfc9474.json", relativeTo: URL(fileURLWithPath: #file) )) } diff --git a/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift b/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift index 413d1855..50699934 100644 --- a/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift +++ b/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import XCTest import Crypto -import _CryptoExtras // NOTE: No @testable import, because we want to test the public API. +import CryptoExtras // NOTE: No @testable import, because we want to test the public API. final class TestRSABlindSigningAPI: XCTestCase { func testEndToEnd() throws { diff --git a/Tests/CryptoExtrasTests/TestRSAEncryption.swift b/Tests/CryptoExtrasTests/TestRSAEncryption.swift index 63ad1e0f..6f318de8 100644 --- a/Tests/CryptoExtrasTests/TestRSAEncryption.swift +++ b/Tests/CryptoExtrasTests/TestRSAEncryption.swift @@ -14,7 +14,7 @@ import Foundation import XCTest import Crypto -import _CryptoExtras +import CryptoExtras final class TestRSAEncryption: XCTestCase { diff --git a/Tests/CryptoExtrasTests/TestRSASigning.swift b/Tests/CryptoExtrasTests/TestRSASigning.swift index 07da7c12..9bf2cf2e 100644 --- a/Tests/CryptoExtrasTests/TestRSASigning.swift +++ b/Tests/CryptoExtrasTests/TestRSASigning.swift @@ -15,7 +15,7 @@ import Foundation import XCTest import Crypto import CryptoBoringWrapper -@testable import _CryptoExtras +@testable import CryptoExtras final class TestRSASigning: XCTestCase { diff --git a/Tests/CryptoExtrasTests/Utils/RFCVector.swift b/Tests/CryptoExtrasTests/Utils/RFCVector.swift index 52c52e9e..28781cf4 100644 --- a/Tests/CryptoExtrasTests/Utils/RFCVector.swift +++ b/Tests/CryptoExtrasTests/Utils/RFCVector.swift @@ -26,7 +26,7 @@ struct RFCVectorDecoder { init(bundleType: AnyObject, fileName: String) throws { let testsDirectory: String = URL(fileURLWithPath: "\(#file)").pathComponents.dropLast(3).joined(separator: "/") - let fileURL: URL? = URL(fileURLWithPath: "\(testsDirectory)/_CryptoExtrasVectors/\(fileName).txt") + let fileURL: URL? = URL(fileURLWithPath: "\(testsDirectory)/CryptoExtrasVectors/\(fileName).txt") let rfcVectorData = try Data(contentsOf: fileURL!) self.rfcVectorData = String(decoding: rfcVectorData, as: Unicode.UTF8.self) diff --git a/Tests/CryptoExtrasTests/Utils/Wycheproof.swift b/Tests/CryptoExtrasTests/Utils/Wycheproof.swift index 838a9a8b..b1c883f3 100644 --- a/Tests/CryptoExtrasTests/Utils/Wycheproof.swift +++ b/Tests/CryptoExtrasTests/Utils/Wycheproof.swift @@ -22,7 +22,7 @@ struct WycheproofTest: Codable { extension XCTestCase { func wycheproofTest(jsonName: String, file: StaticString = #file, line: UInt = #line, testFunction: (T) throws -> Void) throws { let testsDirectory: String = URL(fileURLWithPath: "\(#file)").pathComponents.dropLast(3).joined(separator: "/") - let fileURL: URL? = URL(fileURLWithPath: "\(testsDirectory)/_CryptoExtrasVectors/\(jsonName).json") + let fileURL: URL? = URL(fileURLWithPath: "\(testsDirectory)/CryptoExtrasVectors/\(jsonName).json") let data = try Data(contentsOf: fileURL!) From 733924e42d1429ff32d8965bf1f006238a446e07 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 19:07:43 +0100 Subject: [PATCH 3/6] Update the README --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9a72b1c3..7e0461db 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,12 @@ Swift Crypto is an open-source implementation of a substantial portion of the AP Swift Crypto is available as a Swift Package Manager package. To use it, add the following dependency in your `Package.swift`: ```swift -// swift-crypto 1.x, 2.x and 3.x are almost API compatible, so most clients -// should allow any of them -.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"), +// swift-crypto 1.x, 2.x, 3.x and 4.x are almost API compatible, for the Crypto library, +// so most clients should allow any of them: +.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "5.0.0"), + +// If using CryptoExtras, this was called _CryptoExtras in 1.x to 3.x so you should only allow 4.x: +.package(url: "https://github.com/apple/swift-crypto.git", from: "4.0.0"), ``` and to your target, add `Crypto` to your dependencies. You can then `import Crypto` to get access to Swift Crypto's functionality. @@ -34,7 +37,7 @@ When building Swift Crypto for use on Linux, Swift Crypto builds substantially m 2. The common API of Swift Crypto and CryptoKit. 3. The backing implementation of this common API, which calls into BoringSSL. -The API code, and some cryptographic primitives which are directly implemented in Swift, are exactly the same for both Apple CryptoKit and Swift Crypto. The backing BoringSSL-based implementation is unique to Swift Crypto. +The API code, and some cryptographic primitives which are directly implemented in Swift, are exactly the same for both Apple CryptoKit and Swift Crypto. The backing BoringSSL-based implementation is unique to Swift Crypto. In addition, there is another product, `CryptoExtras`, which provides additional functionality that is not offered in CryptoKit, which contains cryptographic APIS predominantly useful in the server ecosystem. **Note**: if you depend on CryptoExtras you'll bundle the BoringSSL implementation of the library in your application, no matter the platform. ## Evolution From 8316d700ac7f584b8518f4da11f0e3efe9c68d05 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 20:47:58 +0100 Subject: [PATCH 4/6] Update README --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7e0461db..e06ad2bc 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,9 @@ Swift Crypto is an open-source implementation of a substantial portion of the AP Swift Crypto is available as a Swift Package Manager package. To use it, add the following dependency in your `Package.swift`: ```swift -// swift-crypto 1.x, 2.x, 3.x and 4.x are almost API compatible, for the Crypto library, +// swift-crypto 1.x, 2.x, 3.x and 4.x are almost API compatible, // so most clients should allow any of them: -.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "5.0.0"), - -// If using CryptoExtras, this was called _CryptoExtras in 1.x to 3.x so you should only allow 4.x: -.package(url: "https://github.com/apple/swift-crypto.git", from: "4.0.0"), +.package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"), ``` and to your target, add `Crypto` to your dependencies. You can then `import Crypto` to get access to Swift Crypto's functionality. From 636fb3f96d7a8dee31c11b6a92cbcb4f3c2dbf87 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 20:48:42 +0100 Subject: [PATCH 5/6] Reduce noise --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e06ad2bc..5edd355e 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Swift Crypto is an open-source implementation of a substantial portion of the AP Swift Crypto is available as a Swift Package Manager package. To use it, add the following dependency in your `Package.swift`: ```swift -// swift-crypto 1.x, 2.x, 3.x and 4.x are almost API compatible, -// so most clients should allow any of them: +// swift-crypto 1.x, 2.x and 3.x are almost API compatible, so most clients +// should allow any of them .package(url: "https://github.com/apple/swift-crypto.git", "1.0.0" ..< "4.0.0"), ``` From db87983f9229f23d93d81a3bfa7bda91ed90a1c3 Mon Sep 17 00:00:00 2001 From: Tim <0xtimc@gmail.com> Date: Wed, 16 Oct 2024 20:49:57 +0100 Subject: [PATCH 6/6] Update Cmake files --- Sources/CMakeLists.txt | 2 +- Sources/CryptoExtras/CMakeLists.txt | 14 +++++++------- scripts/update-cmake-lists.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 0b6c1643..be79511b 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -16,4 +16,4 @@ add_subdirectory(CCryptoBoringSSL) add_subdirectory(CCryptoBoringSSLShims) add_subdirectory(CryptoBoringWrapper) add_subdirectory(Crypto) -add_subdirectory(_CryptoExtras) +add_subdirectory(CryptoExtras) diff --git a/Sources/CryptoExtras/CMakeLists.txt b/Sources/CryptoExtras/CMakeLists.txt index eef4376d..e8d12c35 100644 --- a/Sources/CryptoExtras/CMakeLists.txt +++ b/Sources/CryptoExtras/CMakeLists.txt @@ -12,7 +12,7 @@ ## ##===----------------------------------------------------------------------===## -add_library(_CryptoExtras +add_library(CryptoExtras "ChaCha20CTR/BoringSSL/ChaCha20CTR_boring.swift" "ChaCha20CTR/ChaCha20CTR.swift" "RSA/RSA+BlindSigning.swift" @@ -27,23 +27,23 @@ add_library(_CryptoExtras "Util/RandomBytes.swift" "Util/SubjectPublicKeyInfo.swift") -target_include_directories(_CryptoExtras PRIVATE +target_include_directories(CryptoExtras PRIVATE $ $) -target_link_libraries(_CryptoExtras PUBLIC +target_link_libraries(CryptoExtras PUBLIC $<$>:Foundation> Crypto CryptoBoringWrapper CCryptoBoringSSL CCryptoBoringSSLShims) -target_compile_options(_CryptoExtras PRIVATE ${SWIFT_CRYPTO_COMPILE_OPTIONS}) +target_compile_options(CryptoExtras PRIVATE ${SWIFT_CRYPTO_COMPILE_OPTIONS}) -target_link_options(_CryptoExtras PRIVATE +target_link_options(CryptoExtras PRIVATE "$<$:SHELL:-Xlinker -framework -Xlinker Security>") -set_target_properties(_CryptoExtras PROPERTIES +set_target_properties(CryptoExtras PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY}) -set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS _CryptoExtras) +set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS CryptoExtras) diff --git a/scripts/update-cmake-lists.sh b/scripts/update-cmake-lists.sh index 46057567..ec4f619a 100755 --- a/scripts/update-cmake-lists.sh +++ b/scripts/update-cmake-lists.sh @@ -93,6 +93,6 @@ update_cmakelists_source "CCryptoBoringSSL" update_cmakelists_source "CCryptoBoringSSLShims" update_cmakelists_source "CryptoBoringWrapper" update_cmakelists_source "Crypto" -update_cmakelists_source "_CryptoExtras" "*/AES/*.swift" +update_cmakelists_source "CryptoExtras" "*/AES/*.swift" update_cmakelists_assembly "CCryptoBoringSSL"