diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 34d248012..3ff06facc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -56,7 +56,7 @@ jobs: { "name": "CXKCP", "type": "source", "exceptions": [] }, { "name": "CXKCPShims", "type": "source", "exceptions": [] }, { "name": "Crypto", "type": "source", "exceptions": [] }, - { "name": "_CryptoExtras", "type": "source", "exceptions": [] }, + { "name": "CryptoExtras", "type": "source", "exceptions": [] }, { "name": "CCryptoBoringSSL", "type": "assembly", "exceptions": [ "*/AES/*.swift" ] } ] } diff --git a/.gitignore b/.gitignore index 9b3fae344..98fffc86e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .DS_Store -/.build +.build /out /Packages /*.xcodeproj @@ -12,6 +12,7 @@ Package.resolved DerivedData .swiftpm **/gyb.pyc +scripts/__pycache__/ .*.sw[nop] diff --git a/.spi.yml b/.spi.yml index f26c856c9..f432bfa46 100644 --- a/.spi.yml +++ b/.spi.yml @@ -1,5 +1,5 @@ version: 1 builder: configs: - - documentation_targets: [Crypto, _CryptoExtras] + - documentation_targets: [Crypto, CryptoExtras] platform: linux diff --git a/.swiftformatignore b/.swiftformatignore index 13def9f5f..730c28aba 100644 --- a/.swiftformatignore +++ b/.swiftformatignore @@ -69,46 +69,46 @@ Sources/Crypto/Util/PrettyBytes.swift Sources/Crypto/Util/SafeCompare.swift Sources/Crypto/Util/SecureBytes.swift Sources/Crypto/Util/Zeroization.swift -Sources/_CryptoExtras/AES/AES_CBC.swift -Sources/_CryptoExtras/AES/AES_CFB.swift -Sources/_CryptoExtras/AES/AES_CTR.swift -Sources/_CryptoExtras/AES/AES_GCM_SIV.swift -Sources/_CryptoExtras/AES/Block Function.swift -Sources/_CryptoExtras/ARC/ARC+API.swift -Sources/_CryptoExtras/ARC/ARC.swift -Sources/_CryptoExtras/ARC/ARCCredential.swift -Sources/_CryptoExtras/ARC/ARCEncoding.swift -Sources/_CryptoExtras/ARC/ARCPrecredential.swift -Sources/_CryptoExtras/ARC/ARCPresentation.swift -Sources/_CryptoExtras/ARC/ARCRequest.swift -Sources/_CryptoExtras/ARC/ARCResponse.swift -Sources/_CryptoExtras/ARC/ARCServer.swift -Sources/_CryptoExtras/ZKPs/Prover.swift -Sources/_CryptoExtras/ZKPs/Verifier.swift -Sources/_CryptoExtras/ZKPs/ZKPToolbox.swift -Sources/_CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift -Sources/_CryptoExtras/ECToolbox/ECToolbox.swift -Sources/_CryptoExtras/H2G/HashToField.swift -Sources/_CryptoExtras/Key Derivation/KDF.swift -Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift -Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift -Sources/_CryptoExtras/OPRFs/OPRF.swift -Sources/_CryptoExtras/OPRFs/OPRFClient.swift -Sources/_CryptoExtras/OPRFs/OPRFServer.swift -Sources/_CryptoExtras/OPRFs/VOPRF+API.swift -Sources/_CryptoExtras/OPRFs/VOPRFClient.swift -Sources/_CryptoExtras/OPRFs/VOPRFServer.swift -Sources/_CryptoExtras/RSA/RSA+BlindSigning.swift -Sources/_CryptoExtras/RSA/RSA.swift -Sources/_CryptoExtras/Util/BoringSSLHelpers.swift -Sources/_CryptoExtras/Util/DigestType.swift -Sources/_CryptoExtras/Util/Error.swift -Sources/_CryptoExtras/Util/I2OSP.swift -Sources/_CryptoExtras/Util/IntegerEncoding.swift -Sources/_CryptoExtras/Util/PEMDocument.swift -Sources/_CryptoExtras/Util/PrettyBytes.swift -Sources/_CryptoExtras/Util/SubjectPublicKeyInfo.swift -Sources/_CryptoExtras/ZKPs/DLEQ.swift +Sources/CryptoExtras/AES/AES_CBC.swift +Sources/CryptoExtras/AES/AES_CFB.swift +Sources/CryptoExtras/AES/AES_CTR.swift +Sources/CryptoExtras/AES/AES_GCM_SIV.swift +Sources/CryptoExtras/AES/Block Function.swift +Sources/CryptoExtras/ARC/ARC+API.swift +Sources/CryptoExtras/ARC/ARC.swift +Sources/CryptoExtras/ARC/ARCCredential.swift +Sources/CryptoExtras/ARC/ARCEncoding.swift +Sources/CryptoExtras/ARC/ARCPrecredential.swift +Sources/CryptoExtras/ARC/ARCPresentation.swift +Sources/CryptoExtras/ARC/ARCRequest.swift +Sources/CryptoExtras/ARC/ARCResponse.swift +Sources/CryptoExtras/ARC/ARCServer.swift +Sources/CryptoExtras/ZKPs/Prover.swift +Sources/CryptoExtras/ZKPs/Verifier.swift +Sources/CryptoExtras/ZKPs/ZKPToolbox.swift +Sources/CryptoExtras/ChaCha20CTR/ChaCha20CTR.swift +Sources/CryptoExtras/ECToolbox/ECToolbox.swift +Sources/CryptoExtras/H2G/HashToField.swift +Sources/CryptoExtras/Key Derivation/KDF.swift +Sources/CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift +Sources/CryptoExtras/Key Derivation/Scrypt/Scrypt.swift +Sources/CryptoExtras/OPRFs/OPRF.swift +Sources/CryptoExtras/OPRFs/OPRFClient.swift +Sources/CryptoExtras/OPRFs/OPRFServer.swift +Sources/CryptoExtras/OPRFs/VOPRF+API.swift +Sources/CryptoExtras/OPRFs/VOPRFClient.swift +Sources/CryptoExtras/OPRFs/VOPRFServer.swift +Sources/CryptoExtras/RSA/RSA+BlindSigning.swift +Sources/CryptoExtras/RSA/RSA.swift +Sources/CryptoExtras/Util/BoringSSLHelpers.swift +Sources/CryptoExtras/Util/DigestType.swift +Sources/CryptoExtras/Util/Error.swift +Sources/CryptoExtras/Util/I2OSP.swift +Sources/CryptoExtras/Util/IntegerEncoding.swift +Sources/CryptoExtras/Util/PEMDocument.swift +Sources/CryptoExtras/Util/PrettyBytes.swift +Sources/CryptoExtras/Util/SubjectPublicKeyInfo.swift +Sources/CryptoExtras/ZKPs/DLEQ.swift Sources/crypto-shasum/main.swift Tests/CryptoTests/ASN1/ASN1Tests.swift Tests/CryptoTests/ASN1/GeneralizedTimeTests.swift @@ -141,31 +141,31 @@ Tests/CryptoTests/Utils/RFCVector.swift Tests/CryptoTests/Utils/SplitData.swift Tests/CryptoTests/Utils/Wycheproof.swift Tests/CryptoTests/Utils/XCTestUtils.swift -Tests/_CryptoExtrasTests/AES Block Function Tests.swift -Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift -Tests/_CryptoExtrasTests/AES_CBCTests.swift -Tests/_CryptoExtrasTests/AES_CFBTests.swift -Tests/_CryptoExtrasTests/AES_CTRTests.swift -Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift -Tests/_CryptoExtrasTests/ARC/ARCEncodingTests.swift -Tests/_CryptoExtrasTests/ARC/ARCPublicAPITests.swift -Tests/_CryptoExtrasTests/ARC/ARCTestVectors.swift -Tests/_CryptoExtrasTests/ARC/ARCTests.swift -Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift -Tests/_CryptoExtrasTests/ECToolbox/HashToCurveTests.swift -Tests/_CryptoExtrasTests/OPRFs/ECVOPRFTests.swift -Tests/_CryptoExtrasTests/OPRFs/VOPRFAPITests.swift -Tests/_CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift -Tests/_CryptoExtrasTests/PBKDF2Tests.swift -Tests/_CryptoExtrasTests/ScryptTests.swift -Tests/_CryptoExtrasTests/TestRSABlindSigning.swift -Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift -Tests/_CryptoExtrasTests/TestRSAEncryption.swift -Tests/_CryptoExtrasTests/TestRSASigning.swift -Tests/_CryptoExtrasTests/Util/IntegerEncodingTests.swift -Tests/_CryptoExtrasTests/Utils/BytesUtil.swift -Tests/_CryptoExtrasTests/Utils/RFCVector.swift -Tests/_CryptoExtrasTests/Utils/SplitData.swift -Tests/_CryptoExtrasTests/Utils/Wycheproof.swift -Tests/_CryptoExtrasTests/Utils/XCTestUtils.swift -Tests/_CryptoExtrasTests/ZKPs/ZKPToolbox.swift +Tests/CryptoExtrasTests/AES Block Function Tests.swift +Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift +Tests/CryptoExtrasTests/AES_CBCTests.swift +Tests/CryptoExtrasTests/AES_CFBTests.swift +Tests/CryptoExtrasTests/AES_CTRTests.swift +Tests/CryptoExtrasTests/ARC/ARCAPITests.swift +Tests/CryptoExtrasTests/ARC/ARCEncodingTests.swift +Tests/CryptoExtrasTests/ARC/ARCPublicAPITests.swift +Tests/CryptoExtrasTests/ARC/ARCTestVectors.swift +Tests/CryptoExtrasTests/ARC/ARCTests.swift +Tests/CryptoExtrasTests/ChaCha20CTRTests.swift +Tests/CryptoExtrasTests/ECToolbox/HashToCurveTests.swift +Tests/CryptoExtrasTests/OPRFs/ECVOPRFTests.swift +Tests/CryptoExtrasTests/OPRFs/VOPRFAPITests.swift +Tests/CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift +Tests/CryptoExtrasTests/PBKDF2Tests.swift +Tests/CryptoExtrasTests/ScryptTests.swift +Tests/CryptoExtrasTests/TestRSABlindSigning.swift +Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift +Tests/CryptoExtrasTests/TestRSAEncryption.swift +Tests/CryptoExtrasTests/TestRSASigning.swift +Tests/CryptoExtrasTests/Util/IntegerEncodingTests.swift +Tests/CryptoExtrasTests/Utils/BytesUtil.swift +Tests/CryptoExtrasTests/Utils/RFCVector.swift +Tests/CryptoExtrasTests/Utils/SplitData.swift +Tests/CryptoExtrasTests/Utils/Wycheproof.swift +Tests/CryptoExtrasTests/Utils/XCTestUtils.swift +Tests/CryptoExtrasTests/ZKPs/ZKPToolbox.swift diff --git a/Benchmarks/Benchmarks/Benchmarks.swift b/Benchmarks/Benchmarks/Benchmarks.swift index 155fe1416..dffc12aea 100644 --- a/Benchmarks/Benchmarks/Benchmarks.swift +++ b/Benchmarks/Benchmarks/Benchmarks.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import Benchmark import Crypto -import _CryptoExtras +import CryptoExtras #if canImport(FoundationEssentials) import FoundationEssentials diff --git a/Benchmarks/Package.swift b/Benchmarks/Package.swift index 6b93c2d17..02e116ec0 100644 --- a/Benchmarks/Package.swift +++ b/Benchmarks/Package.swift @@ -14,7 +14,7 @@ let package = Package( dependencies: [ .product(name: "Benchmark", package: "package-benchmark"), .product(name: "Crypto", package: "swift-crypto"), - .product(name: "_CryptoExtras", package: "swift-crypto"), + .product(name: "CryptoExtras", package: "swift-crypto"), ], path: "Benchmarks/", plugins: [ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eef6b8b79..9b4c6ded7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,7 +69,7 @@ act --container-architecture linux/amd64 pull_request -j cmake-lists -W ./.githu 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: ``` -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 +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 ``` ## API Evolution diff --git a/Package.swift b/Package.swift index ddfe1277b..596beb7ec 100644 --- a/Package.swift +++ b/Package.swift @@ -89,7 +89,9 @@ let package = Package( name: "swift-crypto", products: [ .library(name: "Crypto", targets: ["Crypto"]), + // Kept for backward compatibility .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 */ @@ -177,7 +179,7 @@ let package = Package( swiftSettings: swiftSettings ), .target( - name: "_CryptoExtras", + name: "CryptoExtras", dependencies: [ "CCryptoBoringSSL", "CCryptoBoringSSLShims", @@ -191,6 +193,13 @@ let package = Package( resources: privacyManifestResource, swiftSettings: swiftSettings ), + .target( + name: "_CryptoExtras", + dependencies: [ + "CryptoExtras", + ], + swiftSettings: swiftSettings + ), .target( name: "CryptoBoringWrapper", dependencies: [ @@ -219,8 +228,8 @@ let package = Package( swiftSettings: swiftSettings ), .testTarget( - name: "_CryptoExtrasTests", - dependencies: ["_CryptoExtras"], + name: "CryptoExtrasTests", + dependencies: ["CryptoExtras"], resources: [ .copy("ECToolbox/H2CVectors/P256_XMD-SHA-256_SSWU_RO_.json"), .copy("ECToolbox/H2CVectors/P384_XMD-SHA-384_SSWU_RO_.json"), diff --git a/README.md b/README.md index ec5134552..33c5f8686 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ When building Swift Crypto for use on Linux or Windows, Swift Crypto builds subs 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 diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index 55ee7d73b..4616a1f1e 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -18,4 +18,4 @@ add_subdirectory(CXKCP) add_subdirectory(CXKCPShims) add_subdirectory(CryptoBoringWrapper) add_subdirectory(Crypto) -add_subdirectory(_CryptoExtras) +add_subdirectory(CryptoExtras) 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/AES/CMAC.swift b/Sources/CryptoExtras/AES/CMAC.swift similarity index 100% rename from Sources/_CryptoExtras/AES/CMAC.swift rename to Sources/CryptoExtras/AES/CMAC.swift diff --git a/Sources/_CryptoExtras/ARC/ARC+API.swift b/Sources/CryptoExtras/ARC/ARC+API.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARC+API.swift rename to Sources/CryptoExtras/ARC/ARC+API.swift diff --git a/Sources/_CryptoExtras/ARC/ARC.swift b/Sources/CryptoExtras/ARC/ARC.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARC.swift rename to Sources/CryptoExtras/ARC/ARC.swift diff --git a/Sources/_CryptoExtras/ARC/ARCCredential.swift b/Sources/CryptoExtras/ARC/ARCCredential.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCCredential.swift rename to Sources/CryptoExtras/ARC/ARCCredential.swift diff --git a/Sources/_CryptoExtras/ARC/ARCEncoding.swift b/Sources/CryptoExtras/ARC/ARCEncoding.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCEncoding.swift rename to Sources/CryptoExtras/ARC/ARCEncoding.swift diff --git a/Sources/_CryptoExtras/ARC/ARCPrecredential.swift b/Sources/CryptoExtras/ARC/ARCPrecredential.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCPrecredential.swift rename to Sources/CryptoExtras/ARC/ARCPrecredential.swift diff --git a/Sources/_CryptoExtras/ARC/ARCPresentation.swift b/Sources/CryptoExtras/ARC/ARCPresentation.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCPresentation.swift rename to Sources/CryptoExtras/ARC/ARCPresentation.swift diff --git a/Sources/_CryptoExtras/ARC/ARCRequest.swift b/Sources/CryptoExtras/ARC/ARCRequest.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCRequest.swift rename to Sources/CryptoExtras/ARC/ARCRequest.swift diff --git a/Sources/_CryptoExtras/ARC/ARCResponse.swift b/Sources/CryptoExtras/ARC/ARCResponse.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCResponse.swift rename to Sources/CryptoExtras/ARC/ARCResponse.swift diff --git a/Sources/_CryptoExtras/ARC/ARCServer.swift b/Sources/CryptoExtras/ARC/ARCServer.swift similarity index 100% rename from Sources/_CryptoExtras/ARC/ARCServer.swift rename to Sources/CryptoExtras/ARC/ARCServer.swift diff --git a/Sources/_CryptoExtras/CMakeLists.txt b/Sources/CryptoExtras/CMakeLists.txt similarity index 84% rename from Sources/_CryptoExtras/CMakeLists.txt rename to Sources/CryptoExtras/CMakeLists.txt index f7b2f9ab7..8498dc443 100644 --- a/Sources/_CryptoExtras/CMakeLists.txt +++ b/Sources/CryptoExtras/CMakeLists.txt @@ -12,7 +12,7 @@ ## ##===----------------------------------------------------------------------===## -add_library(_CryptoExtras +add_library(CryptoExtras "AES/AES_CBC.swift" "AES/AES_CFB.swift" "AES/AES_CTR.swift" @@ -76,29 +76,29 @@ add_library(_CryptoExtras "ZKPs/ZKPToolbox.swift" ) -target_compile_options(_CryptoExtras PRIVATE -DCRYPTO_IN_SWIFTPM) +target_compile_options(CryptoExtras PRIVATE -DCRYPTO_IN_SWIFTPM) if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") - target_compile_options(_CryptoExtras PRIVATE -DCRYPTO_IN_SWIFTPM_FORCE_BUILD_API) + target_compile_options(CryptoExtras PRIVATE -DCRYPTO_IN_SWIFTPM_FORCE_BUILD_API) endif() -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/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/Docs.docc/index.md b/Sources/CryptoExtras/Docs.docc/index.md similarity index 82% rename from Sources/_CryptoExtras/Docs.docc/index.md rename to Sources/CryptoExtras/Docs.docc/index.md index 50b5eca56..9bda3af77 100644 --- a/Sources/_CryptoExtras/Docs.docc/index.md +++ b/Sources/CryptoExtras/Docs.docc/index.md @@ -1,4 +1,4 @@ -# ``_CryptoExtras`` +# ``CryptoExtras`` Provides additional cryptographic APIs that are not available in CryptoKit (and therefore the core Crypto library). @@ -10,7 +10,7 @@ Provides additional cryptographic APIs that are not available in CryptoKit (and ### Ciphers -- ``_CryptoExtras/Crypto/AES`` +- ``CryptoExtras/Crypto/AES`` ### Public key cryptography @@ -22,4 +22,4 @@ Provides additional cryptographic APIs that are not available in CryptoKit (and ### Legacy algorithms -- ``_CryptoExtras/Crypto/Insecure`` +- ``CryptoExtras/Crypto/Insecure`` diff --git a/Sources/_CryptoExtras/EC/ObjectIdentifier.swift b/Sources/CryptoExtras/EC/ObjectIdentifier.swift similarity index 100% rename from Sources/_CryptoExtras/EC/ObjectIdentifier.swift rename to Sources/CryptoExtras/EC/ObjectIdentifier.swift diff --git a/Sources/_CryptoExtras/EC/PKCS8DERRepresentation.swift b/Sources/CryptoExtras/EC/PKCS8DERRepresentation.swift similarity index 100% rename from Sources/_CryptoExtras/EC/PKCS8DERRepresentation.swift rename to Sources/CryptoExtras/EC/PKCS8DERRepresentation.swift diff --git a/Sources/_CryptoExtras/EC/PKCS8PrivateKey.swift b/Sources/CryptoExtras/EC/PKCS8PrivateKey.swift similarity index 100% rename from Sources/_CryptoExtras/EC/PKCS8PrivateKey.swift rename to Sources/CryptoExtras/EC/PKCS8PrivateKey.swift diff --git a/Sources/_CryptoExtras/EC/RFC8410AlgorithmIdentifier.swift b/Sources/CryptoExtras/EC/RFC8410AlgorithmIdentifier.swift similarity index 100% rename from Sources/_CryptoExtras/EC/RFC8410AlgorithmIdentifier.swift rename to Sources/CryptoExtras/EC/RFC8410AlgorithmIdentifier.swift diff --git a/Sources/_CryptoExtras/ECToolbox/BoringSSL/ECToolbox_boring.swift b/Sources/CryptoExtras/ECToolbox/BoringSSL/ECToolbox_boring.swift similarity index 100% rename from Sources/_CryptoExtras/ECToolbox/BoringSSL/ECToolbox_boring.swift rename to Sources/CryptoExtras/ECToolbox/BoringSSL/ECToolbox_boring.swift diff --git a/Sources/_CryptoExtras/ECToolbox/ECToolbox.swift b/Sources/CryptoExtras/ECToolbox/ECToolbox.swift similarity index 100% rename from Sources/_CryptoExtras/ECToolbox/ECToolbox.swift rename to Sources/CryptoExtras/ECToolbox/ECToolbox.swift diff --git a/Sources/_CryptoExtras/H2G/HashToField.swift b/Sources/CryptoExtras/H2G/HashToField.swift similarity index 100% rename from Sources/_CryptoExtras/H2G/HashToField.swift rename to Sources/CryptoExtras/H2G/HashToField.swift diff --git a/Sources/_CryptoExtras/Key Derivation/KDF.swift b/Sources/CryptoExtras/Key Derivation/KDF.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/KDF.swift rename to Sources/CryptoExtras/Key Derivation/KDF.swift diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift b/Sources/CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift rename to Sources/CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_boring.swift diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift b/Sources/CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift rename to Sources/CryptoExtras/Key Derivation/PBKDF2/BoringSSL/PBKDF2_commoncrypto.swift diff --git a/Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift b/Sources/CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift rename to Sources/CryptoExtras/Key Derivation/PBKDF2/PBKDF2.swift diff --git a/Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift b/Sources/CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift rename to Sources/CryptoExtras/Key Derivation/Scrypt/BoringSSL/Scrypt_boring.swift diff --git a/Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift b/Sources/CryptoExtras/Key Derivation/Scrypt/Scrypt.swift similarity index 100% rename from Sources/_CryptoExtras/Key Derivation/Scrypt/Scrypt.swift rename to Sources/CryptoExtras/Key Derivation/Scrypt/Scrypt.swift diff --git a/Sources/_CryptoExtras/OPRFs/OPRF.swift b/Sources/CryptoExtras/OPRFs/OPRF.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/OPRF.swift rename to Sources/CryptoExtras/OPRFs/OPRF.swift diff --git a/Sources/_CryptoExtras/OPRFs/OPRFClient.swift b/Sources/CryptoExtras/OPRFs/OPRFClient.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/OPRFClient.swift rename to Sources/CryptoExtras/OPRFs/OPRFClient.swift diff --git a/Sources/_CryptoExtras/OPRFs/OPRFServer.swift b/Sources/CryptoExtras/OPRFs/OPRFServer.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/OPRFServer.swift rename to Sources/CryptoExtras/OPRFs/OPRFServer.swift diff --git a/Sources/_CryptoExtras/OPRFs/VOPRF+API.swift b/Sources/CryptoExtras/OPRFs/VOPRF+API.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/VOPRF+API.swift rename to Sources/CryptoExtras/OPRFs/VOPRF+API.swift diff --git a/Sources/_CryptoExtras/OPRFs/VOPRFClient.swift b/Sources/CryptoExtras/OPRFs/VOPRFClient.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/VOPRFClient.swift rename to Sources/CryptoExtras/OPRFs/VOPRFClient.swift diff --git a/Sources/_CryptoExtras/OPRFs/VOPRFServer.swift b/Sources/CryptoExtras/OPRFs/VOPRFServer.swift similarity index 100% rename from Sources/_CryptoExtras/OPRFs/VOPRFServer.swift rename to Sources/CryptoExtras/OPRFs/VOPRFServer.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/Reexport.swift b/Sources/CryptoExtras/Reexport.swift similarity index 100% rename from Sources/_CryptoExtras/Reexport.swift rename to Sources/CryptoExtras/Reexport.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/Data+Extensions.swift b/Sources/CryptoExtras/Util/Data+Extensions.swift similarity index 100% rename from Sources/_CryptoExtras/Util/Data+Extensions.swift rename to Sources/CryptoExtras/Util/Data+Extensions.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/I2OSP.swift b/Sources/CryptoExtras/Util/I2OSP.swift similarity index 100% rename from Sources/_CryptoExtras/Util/I2OSP.swift rename to Sources/CryptoExtras/Util/I2OSP.swift diff --git a/Sources/_CryptoExtras/Util/IntegerEncoding.swift b/Sources/CryptoExtras/Util/IntegerEncoding.swift similarity index 100% rename from Sources/_CryptoExtras/Util/IntegerEncoding.swift rename to Sources/CryptoExtras/Util/IntegerEncoding.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/PrettyBytes.swift b/Sources/CryptoExtras/Util/PrettyBytes.swift similarity index 100% rename from Sources/_CryptoExtras/Util/PrettyBytes.swift rename to Sources/CryptoExtras/Util/PrettyBytes.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/Sources/_CryptoExtras/Util/ThreadSpecific/ThreadOps.swift b/Sources/CryptoExtras/Util/ThreadSpecific/ThreadOps.swift similarity index 100% rename from Sources/_CryptoExtras/Util/ThreadSpecific/ThreadOps.swift rename to Sources/CryptoExtras/Util/ThreadSpecific/ThreadOps.swift diff --git a/Sources/_CryptoExtras/Util/ThreadSpecific/ThreadPosix.swift b/Sources/CryptoExtras/Util/ThreadSpecific/ThreadPosix.swift similarity index 100% rename from Sources/_CryptoExtras/Util/ThreadSpecific/ThreadPosix.swift rename to Sources/CryptoExtras/Util/ThreadSpecific/ThreadPosix.swift diff --git a/Sources/_CryptoExtras/Util/ThreadSpecific/ThreadSpecific.swift b/Sources/CryptoExtras/Util/ThreadSpecific/ThreadSpecific.swift similarity index 100% rename from Sources/_CryptoExtras/Util/ThreadSpecific/ThreadSpecific.swift rename to Sources/CryptoExtras/Util/ThreadSpecific/ThreadSpecific.swift diff --git a/Sources/_CryptoExtras/Util/ThreadSpecific/ThreadWindows.swift b/Sources/CryptoExtras/Util/ThreadSpecific/ThreadWindows.swift similarity index 100% rename from Sources/_CryptoExtras/Util/ThreadSpecific/ThreadWindows.swift rename to Sources/CryptoExtras/Util/ThreadSpecific/ThreadWindows.swift diff --git a/Sources/_CryptoExtras/ZKPs/DLEQ.swift b/Sources/CryptoExtras/ZKPs/DLEQ.swift similarity index 100% rename from Sources/_CryptoExtras/ZKPs/DLEQ.swift rename to Sources/CryptoExtras/ZKPs/DLEQ.swift diff --git a/Sources/_CryptoExtras/ZKPs/Prover.swift b/Sources/CryptoExtras/ZKPs/Prover.swift similarity index 100% rename from Sources/_CryptoExtras/ZKPs/Prover.swift rename to Sources/CryptoExtras/ZKPs/Prover.swift diff --git a/Sources/_CryptoExtras/ZKPs/Verifier.swift b/Sources/CryptoExtras/ZKPs/Verifier.swift similarity index 100% rename from Sources/_CryptoExtras/ZKPs/Verifier.swift rename to Sources/CryptoExtras/ZKPs/Verifier.swift diff --git a/Sources/_CryptoExtras/ZKPs/ZKPToolbox.swift b/Sources/CryptoExtras/ZKPs/ZKPToolbox.swift similarity index 100% rename from Sources/_CryptoExtras/ZKPs/ZKPToolbox.swift rename to Sources/CryptoExtras/ZKPs/ZKPToolbox.swift diff --git a/Sources/_CryptoExtras/Exports.swift b/Sources/_CryptoExtras/Exports.swift new file mode 100644 index 000000000..8423e7c02 --- /dev/null +++ b/Sources/_CryptoExtras/Exports.swift @@ -0,0 +1,15 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the SwiftCrypto open source project +// +// Copyright (c) 2019 Apple Inc. and the SwiftCrypto project authors +// Licensed under Apache License v2.0 +// +// See LICENSE.txt for license information +// See CONTRIBUTORS.txt for the list of SwiftCrypto project authors +// +// SPDX-License-Identifier: Apache-2.0 +// +//===----------------------------------------------------------------------===// + +@_exported import CryptoExtras diff --git a/Tests/_CryptoExtrasTests/AES Block Function Tests.swift b/Tests/CryptoExtrasTests/AES Block Function Tests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/AES Block Function Tests.swift rename to Tests/CryptoExtrasTests/AES Block Function Tests.swift index 926cc04fc..f895a23c1 100644 --- a/Tests/_CryptoExtrasTests/AES Block Function Tests.swift +++ b/Tests/CryptoExtrasTests/AES Block Function Tests.swift @@ -18,7 +18,7 @@ import Foundation #endif 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 similarity index 99% rename from Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift rename to Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift index 3d5ddea5b..8f3c68880 100644 --- a/Tests/_CryptoExtrasTests/AES-GCM-SIV-Runner.swift +++ b/Tests/CryptoExtrasTests/AES-GCM-SIV-Runner.swift @@ -18,7 +18,7 @@ import Foundation #endif 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 similarity index 99% rename from Tests/_CryptoExtrasTests/AES_CBCTests.swift rename to Tests/CryptoExtrasTests/AES_CBCTests.swift index c2a9a5eed..11fa7ec45 100644 --- a/Tests/_CryptoExtrasTests/AES_CBCTests.swift +++ b/Tests/CryptoExtrasTests/AES_CBCTests.swift @@ -18,7 +18,7 @@ import FoundationEssentials #else import Foundation #endif -import _CryptoExtras +import CryptoExtras import XCTest final class CBCTests: XCTestCase { @@ -162,7 +162,7 @@ final class CBCTests: XCTestCase { } } } - + func testToDataConversion() throws { let randomBytes = (0..<16).map { _ in UInt8.random(in: UInt8.min...UInt8.max) } let dataIn = Data(randomBytes) diff --git a/Tests/_CryptoExtrasTests/AES_CFBTests.swift b/Tests/CryptoExtrasTests/AES_CFBTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/AES_CFBTests.swift rename to Tests/CryptoExtrasTests/AES_CFBTests.swift index 8f23bc6d9..207a4d33e 100644 --- a/Tests/_CryptoExtrasTests/AES_CFBTests.swift +++ b/Tests/CryptoExtrasTests/AES_CFBTests.swift @@ -14,7 +14,7 @@ import Crypto import CryptoBoringWrapper -@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 similarity index 99% rename from Tests/_CryptoExtrasTests/AES_CTRTests.swift rename to Tests/CryptoExtrasTests/AES_CTRTests.swift index 2206967f9..b2842a242 100644 --- a/Tests/_CryptoExtrasTests/AES_CTRTests.swift +++ b/Tests/CryptoExtrasTests/AES_CTRTests.swift @@ -18,7 +18,7 @@ import FoundationEssentials #else import Foundation #endif -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest final class AESCTRTests: XCTestCase { diff --git a/Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift b/Tests/CryptoExtrasTests/ARC/ARCAPITests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift rename to Tests/CryptoExtrasTests/ARC/ARCAPITests.swift index 2a6f0f88b..9e71f6279 100644 --- a/Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift +++ b/Tests/CryptoExtrasTests/ARC/ARCAPITests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest @available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *) diff --git a/Tests/_CryptoExtrasTests/ARC/ARCEncodingTests.swift b/Tests/CryptoExtrasTests/ARC/ARCEncodingTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ARC/ARCEncodingTests.swift rename to Tests/CryptoExtrasTests/ARC/ARCEncodingTests.swift index c65a6aa24..e9516c5ec 100644 --- a/Tests/_CryptoExtrasTests/ARC/ARCEncodingTests.swift +++ b/Tests/CryptoExtrasTests/ARC/ARCEncodingTests.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest import Crypto diff --git a/Tests/_CryptoExtrasTests/ARC/ARCPublicAPITests.swift b/Tests/CryptoExtrasTests/ARC/ARCPublicAPITests.swift similarity index 98% rename from Tests/_CryptoExtrasTests/ARC/ARCPublicAPITests.swift rename to Tests/CryptoExtrasTests/ARC/ARCPublicAPITests.swift index 411e1066c..a54b4a11b 100644 --- a/Tests/_CryptoExtrasTests/ARC/ARCPublicAPITests.swift +++ b/Tests/CryptoExtrasTests/ARC/ARCPublicAPITests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// 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. import XCTest @available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *) diff --git a/Tests/_CryptoExtrasTests/ARC/ARCTestVectors.swift b/Tests/CryptoExtrasTests/ARC/ARCTestVectors.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ARC/ARCTestVectors.swift rename to Tests/CryptoExtrasTests/ARC/ARCTestVectors.swift index b8b43556d..1dc00aed7 100644 --- a/Tests/_CryptoExtrasTests/ARC/ARCTestVectors.swift +++ b/Tests/CryptoExtrasTests/ARC/ARCTestVectors.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest let ARCEncodedTestVector = """ diff --git a/Tests/_CryptoExtrasTests/ARC/ARCTests.swift b/Tests/CryptoExtrasTests/ARC/ARCTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ARC/ARCTests.swift rename to Tests/CryptoExtrasTests/ARC/ARCTests.swift index d2c4dd8bd..5db48770b 100644 --- a/Tests/_CryptoExtrasTests/ARC/ARCTests.swift +++ b/Tests/CryptoExtrasTests/ARC/ARCTests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest @available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *) diff --git a/Tests/_CryptoExtrasTests/CMACTests.swift b/Tests/CryptoExtrasTests/CMACTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/CMACTests.swift rename to Tests/CryptoExtrasTests/CMACTests.swift index b33f13c84..386d906ec 100644 --- a/Tests/_CryptoExtrasTests/CMACTests.swift +++ b/Tests/CryptoExtrasTests/CMACTests.swift @@ -12,9 +12,9 @@ // //===----------------------------------------------------------------------===// import Crypto +import CryptoExtras import Foundation import XCTest -import _CryptoExtras final class CMACTests: XCTestCase { // Borrowed from CryptoKit diff --git a/Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift b/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift rename to Tests/CryptoExtrasTests/ChaCha20CTRTests.swift index fde4a79fc..175645680 100644 --- a/Tests/_CryptoExtrasTests/ChaCha20CTRTests.swift +++ b/Tests/CryptoExtrasTests/ChaCha20CTRTests.swift @@ -18,7 +18,7 @@ import Foundation #endif import XCTest import Crypto -import _CryptoExtras +import CryptoExtras class ChaCha20CTRTests: XCTestCase { diff --git a/Tests/_CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift b/Tests/CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift similarity index 98% rename from Tests/_CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift rename to Tests/CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift index 57d0eb540..0bb98375c 100644 --- a/Tests/_CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift +++ b/Tests/CryptoExtrasTests/ECToolbox/BoringSSL/ECToolboxBoringSSLTests.swift @@ -17,10 +17,10 @@ import XCTest #if !canImport(Darwin) || canImport(CryptoKit, _version: 241.100.42) // Corresponds to the CryptoKit in XCode 16.3, which has Sendable annotations import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras #else @preconcurrency import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras #endif final class ECToolboxBoringSSLTests: XCTestCase { diff --git a/Tests/_CryptoExtrasTests/ECToolbox/H2CVectors/P256_XMD-SHA-256_SSWU_RO_.json b/Tests/CryptoExtrasTests/ECToolbox/H2CVectors/P256_XMD-SHA-256_SSWU_RO_.json similarity index 100% rename from Tests/_CryptoExtrasTests/ECToolbox/H2CVectors/P256_XMD-SHA-256_SSWU_RO_.json rename to Tests/CryptoExtrasTests/ECToolbox/H2CVectors/P256_XMD-SHA-256_SSWU_RO_.json diff --git a/Tests/_CryptoExtrasTests/ECToolbox/H2CVectors/P384_XMD-SHA-384_SSWU_RO_.json b/Tests/CryptoExtrasTests/ECToolbox/H2CVectors/P384_XMD-SHA-384_SSWU_RO_.json similarity index 100% rename from Tests/_CryptoExtrasTests/ECToolbox/H2CVectors/P384_XMD-SHA-384_SSWU_RO_.json rename to Tests/CryptoExtrasTests/ECToolbox/H2CVectors/P384_XMD-SHA-384_SSWU_RO_.json diff --git a/Tests/_CryptoExtrasTests/ECToolbox/HashToCurveTests.swift b/Tests/CryptoExtrasTests/ECToolbox/HashToCurveTests.swift similarity index 98% rename from Tests/_CryptoExtrasTests/ECToolbox/HashToCurveTests.swift rename to Tests/CryptoExtrasTests/ECToolbox/HashToCurveTests.swift index 88efc4e3a..4e1179a54 100644 --- a/Tests/_CryptoExtrasTests/ECToolbox/HashToCurveTests.swift +++ b/Tests/CryptoExtrasTests/ECToolbox/HashToCurveTests.swift @@ -12,13 +12,13 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest struct HashToCurveTestVectorCurvePoint: Codable { let x: String let y: String - + var rawRepresentation: Data { return try! Data(hexString: String(x.dropFirst(2))) + Data(hexString: String(y.dropFirst(2))) } @@ -44,28 +44,28 @@ class HashToCurveTests: XCTestCase { let bundle = Bundle(for: type(of: self)) #endif let fileURL = bundle.url(forResource: file, withExtension: "json") - + let data = try Data(contentsOf: fileURL!) let decoder = JSONDecoder() let testVectorFile = try decoder.decode(HashToCurveTestVectorFile.self, from: data) - + let dst = testVectorFile.dst - + for vector in testVectorFile.vectors { let msg = vector.msg.data(using: .ascii)! - + let point = h2c.hashToGroup(msg, domainSeparationString: Data(dst.utf8)) - + XCTAssert(point.oprfRepresentation.hexString.dropFirst(2) == vector.P.x.dropFirst(2)) } } - + func testVectors() throws { try testVector(vectorFileName: "P256_XMD-SHA-256_SSWU_RO_", with: HashToCurveImpl.self) try testVector(vectorFileName: "P384_XMD-SHA-384_SSWU_RO_", with: HashToCurveImpl.self) // try testVector(vectorFileName: "P521_XMD-SHA-512_SSWU_RO_", with: HashToCurveImpl.self) } - + func testH2F() throws { let data = try! Data(hexString: "436f6e746578742d564f50524630372d00000300097465737420696e666f") let dst = try! Data(hexString: "48617368546f5363616c61722d564f50524630372d000003") diff --git a/Tests/_CryptoExtrasTests/MLDSATests.swift b/Tests/CryptoExtrasTests/MLDSATests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/MLDSATests.swift rename to Tests/CryptoExtrasTests/MLDSATests.swift index 87e2b765d..cbf49a809 100644 --- a/Tests/_CryptoExtrasTests/MLDSATests.swift +++ b/Tests/CryptoExtrasTests/MLDSATests.swift @@ -16,7 +16,7 @@ import XCTest -@testable import _CryptoExtras +@testable import CryptoExtras final class MLDSATests: XCTestCase { func testMLDSA65Signing() throws { @@ -232,7 +232,7 @@ final class MLDSATests: XCTestCase { for _ in 0..<2 { fileURL.deleteLastPathComponent() } - fileURL = fileURL.appendingPathComponent("_CryptoExtrasVectors", isDirectory: true) + fileURL = fileURL.appendingPathComponent("CryptoExtrasVectors", isDirectory: true) fileURL = fileURL.appendingPathComponent("\(jsonName).json", isDirectory: false) let data = try Data(contentsOf: fileURL) diff --git a/Tests/_CryptoExtrasTests/MLKEMTests.swift b/Tests/CryptoExtrasTests/MLKEMTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/MLKEMTests.swift rename to Tests/CryptoExtrasTests/MLKEMTests.swift index ae6351ca3..21fd730ee 100644 --- a/Tests/_CryptoExtrasTests/MLKEMTests.swift +++ b/Tests/CryptoExtrasTests/MLKEMTests.swift @@ -16,7 +16,7 @@ import Crypto import XCTest -@testable import _CryptoExtras +@testable import CryptoExtras final class MLKEMTests: XCTestCase { func testMLKEM768() throws { diff --git a/Tests/_CryptoExtrasTests/OPRFs/ECVOPRFTests.swift b/Tests/CryptoExtrasTests/OPRFs/ECVOPRFTests.swift similarity index 96% rename from Tests/_CryptoExtrasTests/OPRFs/ECVOPRFTests.swift rename to Tests/CryptoExtrasTests/OPRFs/ECVOPRFTests.swift index cb0c4216c..7fd919c49 100644 --- a/Tests/_CryptoExtrasTests/OPRFs/ECVOPRFTests.swift +++ b/Tests/CryptoExtrasTests/OPRFs/ECVOPRFTests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest struct OPRFSuite: Codable { @@ -64,50 +64,50 @@ class ECVOPRFTests: XCTestCase { fatalError("Unknown mode") } } - + func testBaseSuite(suite: OPRFSuite, C: G.Type, v8DraftCompatible: Bool) throws { print("Testing \(suite.suiteName ?? suite.identifier!) in base mode.") - + let privateKey = try GroupImpl.Scalar(bytes: Data(hexString: suite.skSm)) let ciphersuite = OPRF.Ciphersuite(HashToCurveImpl.self) - + for vector in suite.vectors { if vector.Batch != 1 { continue } - + let client = OPRF.Client(mode: .base, ciphersuite: ciphersuite, v8CompatibilityMode: v8DraftCompatible) let blindTestVector = try GroupImpl.Scalar(bytes: Data(hexString: vector.Blind)) let input = try Data(hexString: vector.Input) - + let (blind, blindedElement) = client.blindMessage(input, blind: blindTestVector) - + XCTAssert(blindTestVector == blind) XCTAssert(blindedElement.oprfRepresentation.hexString == vector.BlindedElement) - + let server = OPRF.Server(mode: .base, ciphersuite: ciphersuite, privateKey: privateKey, v8CompatibilityMode: v8DraftCompatible) - + var info = Data() if vector.Info != nil { info = try Data(hexString: vector.Info!) } - + let evaluate = try server.evaluate(blindedElement: blindedElement, info: info) - + let evaluatedElementTv = try GroupImpl.Element(oprfRepresentation: Data(hexString: vector.EvaluationElement)) XCTAssert(evaluate.0 == evaluatedElementTv) - + let finalized = try client.finalize(message: input, info: info, blind: blind, evaluatedElement: evaluate.0) - + XCTAssert(finalized.hexString == vector.Output) XCTAssert(try server.verifyFinalize(msg: input, output: finalized, info: info)) } } - + func testVerifiableSuite(suite: OPRFSuite, C: G.Type, v8DraftCompatible: Bool, mode: OPRF.Mode) throws { print("Testing \(suite.suiteName ?? suite.identifier!) in \(mode) mode.") - + let privateKey = try GroupImpl.Scalar(bytes: Data(hexString: suite.skSm)) let ciphersuite = OPRF.Ciphersuite(HashToCurveImpl.self) @@ -119,23 +119,23 @@ class ECVOPRFTests: XCTestCase { let client = try! OPRF.VerifiableClient(ciphersuite: ciphersuite, v8CompatibilityMode: v8DraftCompatible, mode: mode) let blindTestVector = try GroupImpl.Scalar(bytes: Data(hexString: vector.Blind)) let input = try Data(hexString: vector.Input) - + let (blind, blindedElement) = client.blindMessage(input, blind: blindTestVector) - + XCTAssert(blindTestVector == blind) XCTAssert(blindedElement.oprfRepresentation.hexString == vector.BlindedElement) - + let server = try! OPRF.VerifiableServer(ciphersuite: ciphersuite, privateKey: privateKey, v8CompatibilityMode: v8DraftCompatible, mode: mode) let proofBlind = try GroupImpl.Scalar(bytes: Data(hexString: vector.Proof!.r)) - + var info: Data? if (vector.Info?.count ?? 0) > 0 { info = try Data(hexString: vector.Info!) } let evaluate = try server.evaluate(blindedElement: blindedElement, info: info, proofScalar: proofBlind) - + let evaluatedElementTv = try GroupImpl.Element(oprfRepresentation: Data(hexString: vector.EvaluationElement)) XCTAssert(evaluate.0 == evaluatedElementTv) - + let proof_tv = vector.Proof!.proof let c_tv = try GroupImpl.Scalar(bytes: Data(hexString: String(proof_tv.prefix(proof_tv.count / 2)))) let s_tv = try GroupImpl.Scalar(bytes: Data(hexString: String(proof_tv.suffix(proof_tv.count / 2)))) @@ -169,7 +169,7 @@ class ECVOPRFTests: XCTestCase { } } } - + func testVectors() throws { print("Testing VOPRF Draft8 vectors.") try testVectors(filename: "OPRFVectors-VOPRFDraft8", v8DraftCompatible: true) @@ -178,7 +178,7 @@ class ECVOPRFTests: XCTestCase { print("Testing VOPRF edge case vectors.") try testVectors(filename: "OPRFVectors-edgecases", v8DraftCompatible: false) } - + func testVectors(filename: String, v8DraftCompatible: Bool) throws { #if CRYPTO_IN_SWIFTPM let bundle = Bundle.module @@ -187,11 +187,11 @@ class ECVOPRFTests: XCTestCase { #endif let fileURL = bundle.url(forResource: filename, withExtension: "json") - + let data = try Data(contentsOf: fileURL!) let decoder = JSONDecoder() let suites = try decoder.decode([OPRFSuite].self, from: data) - + if v8DraftCompatible { for suite in suites { switch (suite.suiteID, suite.mode) { @@ -204,7 +204,7 @@ class ECVOPRFTests: XCTestCase { // case (OPRF.Ciphersuite(HashToCurveImpl.self).suiteID, let modeValue): do { // try testSuite(suite: suite, C: P521.self, modeValue: modeValue, v8DraftCompatible: v8DraftCompatible) // } - + default: print("Unsupported Ciphersuite: \(suite.suiteName ?? suite.identifier!)") } @@ -221,67 +221,67 @@ class ECVOPRFTests: XCTestCase { // case (OPRF.Ciphersuite(HashToCurveImpl.self).stringIdentifier, let modeValue): do { // try testSuite(suite: suite, C: P521.self, modeValue: modeValue, v8DraftCompatible: v8DraftCompatible) // } - + default: print("Unsupported Ciphersuite: \(suite.suiteName ?? suite.identifier!)") } } } } - + func testDistributivity() throws { let r = GroupImpl.Scalar.random - + let a = GroupImpl.Scalar.random let b = GroupImpl.Scalar.random - + let ab = (a + b) let ar = a * r let br = b * r - + XCTAssert(ab - b == a) XCTAssert(ab - a == b) - + let arbr = (ab) * r - + XCTAssert(arbr - br == ar) XCTAssert(arbr - ar == br) } - + func testMath() throws { let r = GroupImpl.Scalar.random let k = GroupImpl.Scalar.random let c = GroupImpl.Scalar.random - + let A = GroupImpl.Element.generator let B = k * A - + let m = GroupImpl.Scalar.random let z = k * m - + let t2 = r * A let t3 = r * m - + let s = (r - c * k) let t2_recontructed = (s * A) + (c * B) let t3_reconstructed = ((s * m) + (c * z)) - + XCTAssert(t2 == t2_recontructed) XCTAssert(t3.rawRepresentation == t3_reconstructed.rawRepresentation) } - + func testDLEQProver() throws { let k = GroupImpl.Scalar.random let A = GroupImpl.Element.generator let B = k * A - + let C = GroupImpl.Element.random let D = k * C - + let CDs = [(C: C, D: D)] - + let proof = try DLEQ>.proveEquivalenceBetween(k: k, A: A, B: B, CDs: CDs, dst: Data(), proofScalar: .random, v8CompatibilityMode: false) - + XCTAssert(try DLEQ>.verifyProof(A: A, B: B, CDs: CDs, proof: proof, dst: Data(), v8CompatibilityMode: false)) } } diff --git a/Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft19.json b/Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft19.json similarity index 100% rename from Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft19.json rename to Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft19.json diff --git a/Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft8.json b/Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft8.json similarity index 100% rename from Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft8.json rename to Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-VOPRFDraft8.json diff --git a/Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-edgecases.json b/Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-edgecases.json similarity index 100% rename from Tests/_CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-edgecases.json rename to Tests/CryptoExtrasTests/OPRFs/OPRFVectors/OPRFVectors-edgecases.json diff --git a/Tests/_CryptoExtrasTests/OPRFs/VOPRFAPITests.swift b/Tests/CryptoExtrasTests/OPRFs/VOPRFAPITests.swift similarity index 97% rename from Tests/_CryptoExtrasTests/OPRFs/VOPRFAPITests.swift rename to Tests/CryptoExtrasTests/OPRFs/VOPRFAPITests.swift index cf4582c23..9a34599bd 100644 --- a/Tests/_CryptoExtrasTests/OPRFs/VOPRFAPITests.swift +++ b/Tests/CryptoExtrasTests/OPRFs/VOPRFAPITests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras // NOTE: @testable import, to inject fixed values from test vectors. +@testable import CryptoExtras // NOTE: @testable import, to inject fixed values from test vectors. import XCTest extension OPRFSuite { diff --git a/Tests/_CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift b/Tests/CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift similarity index 97% rename from Tests/_CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift rename to Tests/CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift index 1ec31835a..0fae0be60 100644 --- a/Tests/_CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift +++ b/Tests/CryptoExtrasTests/OPRFs/VOPRFPublicAPITests.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// 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. import XCTest @available(macOS 13.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *) diff --git a/Tests/_CryptoExtrasTests/PBKDF2Tests.swift b/Tests/CryptoExtrasTests/PBKDF2Tests.swift similarity index 96% rename from Tests/_CryptoExtrasTests/PBKDF2Tests.swift rename to Tests/CryptoExtrasTests/PBKDF2Tests.swift index 7fae61a00..05b2fa3af 100644 --- a/Tests/_CryptoExtrasTests/PBKDF2Tests.swift +++ b/Tests/CryptoExtrasTests/PBKDF2Tests.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import XCTest import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras // Test Vectors are coming from https://tools.ietf.org/html/rfc6070 class PBKDF2Tests: XCTestCase { @@ -24,7 +24,7 @@ class PBKDF2Tests: XCTestCase { var rounds: Int var outputLength: Int var derivedKey: [UInt8] - + enum CodingKeys: String, CodingKey { case hash = "Hash" case inputSecret = "P" @@ -34,57 +34,57 @@ class PBKDF2Tests: XCTestCase { case derivedKey = "DK" } } - + func oneshotTesting(_ vector: RFCTestVector, hash: KDF.Insecure.PBKDF2.HashFunction) throws { let (contiguousInput, discontiguousInput) = vector.inputSecret.asDataProtocols() let (contiguousSalt, discontiguousSalt) = vector.salt.asDataProtocols() - + let DK1 = try KDF.Insecure.PBKDF2.deriveKey(from: contiguousInput, salt: contiguousSalt, using: hash, outputByteCount: vector.outputLength, unsafeUncheckedRounds: vector.rounds) - + let DK2 = try KDF.Insecure.PBKDF2.deriveKey(from: discontiguousInput, salt: contiguousSalt, using: hash, outputByteCount: vector.outputLength, unsafeUncheckedRounds: vector.rounds) - + let DK3 = try KDF.Insecure.PBKDF2.deriveKey(from: contiguousInput, salt: discontiguousSalt, using: hash, outputByteCount: vector.outputLength, unsafeUncheckedRounds: vector.rounds) - + let DK4 = try KDF.Insecure.PBKDF2.deriveKey(from: discontiguousInput, salt: discontiguousSalt, using: hash, outputByteCount: vector.outputLength, unsafeUncheckedRounds: vector.rounds) - + let expectedDK = SymmetricKey(data: vector.derivedKey) XCTAssertEqual(DK1, expectedDK) XCTAssertEqual(DK2, expectedDK) XCTAssertEqual(DK3, expectedDK) XCTAssertEqual(DK4, expectedDK) } - + func testRFCVector(_ vector: RFCTestVector, hash: KDF.Insecure.PBKDF2.HashFunction) throws { try oneshotTesting(vector, hash: hash) } - + func testRfcTestVectorsSHA1() throws { var decoder = try orFail { try RFCVectorDecoder(bundleType: self, fileName: "rfc-6070-PBKDF2-SHA1") } let vectors = try orFail { try decoder.decode([RFCTestVector].self) } - + for vector in vectors { precondition(vector.hash == "SHA-1") try orFail { try self.testRFCVector(vector, hash: .insecureSHA1) } } } - + func testRoundsParameterCheck() { let (contiguousInput, contiguousSalt) = (Data("password".utf8), Data("salt".utf8)) - + XCTAssertThrowsError(try KDF.Insecure.PBKDF2.deriveKey(from: contiguousInput, salt: contiguousSalt, using: .insecureSHA1, outputByteCount: 20, rounds: 209_999)) - + XCTAssertNoThrow(try KDF.Insecure.PBKDF2.deriveKey(from: contiguousInput, salt: contiguousSalt, using: .insecureSHA1, outputByteCount: 20, unsafeUncheckedRounds: 209_999)) - + XCTAssertNoThrow(try KDF.Insecure.PBKDF2.deriveKey(from: contiguousInput, salt: contiguousSalt, using: .insecureSHA1, outputByteCount: 20, rounds: 210_000)) } diff --git a/Tests/_CryptoExtrasTests/PKCS8DERRepresentationTests.swift b/Tests/CryptoExtrasTests/PKCS8DERRepresentationTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/PKCS8DERRepresentationTests.swift rename to Tests/CryptoExtrasTests/PKCS8DERRepresentationTests.swift index 1cc754c2d..f464e13bf 100644 --- a/Tests/_CryptoExtrasTests/PKCS8DERRepresentationTests.swift +++ b/Tests/CryptoExtrasTests/PKCS8DERRepresentationTests.swift @@ -16,7 +16,7 @@ import Crypto import Foundation import XCTest -@testable import _CryptoExtras +@testable import CryptoExtras final class PKCS8DERRepresentationTests: XCTestCase { func test_RSA() { diff --git a/Tests/_CryptoExtrasTests/ScryptTests.swift b/Tests/CryptoExtrasTests/ScryptTests.swift similarity index 97% rename from Tests/_CryptoExtrasTests/ScryptTests.swift rename to Tests/CryptoExtrasTests/ScryptTests.swift index 28f828812..40308dab2 100644 --- a/Tests/_CryptoExtrasTests/ScryptTests.swift +++ b/Tests/CryptoExtrasTests/ScryptTests.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// import XCTest import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras // Test Vectors are coming from https://tools.ietf.org/html/rfc7914 class ScryptTests: XCTestCase { @@ -25,7 +25,7 @@ class ScryptTests: XCTestCase { var parallelism: Int var outputLength: Int var derivedKey: [UInt8] - + enum CodingKeys: String, CodingKey { case inputSecret = "P" case salt = "S" @@ -36,50 +36,50 @@ class ScryptTests: XCTestCase { case derivedKey = "DK" } } - + func oneshotTesting(_ vector: RFCTestVector) throws { let (contiguousInput, discontiguousInput) = vector.inputSecret.asDataProtocols() let (contiguousSalt, discontiguousSalt) = vector.salt.asDataProtocols() - + let DK1 = try KDF.Scrypt.deriveKey(from: contiguousInput, salt: contiguousSalt, outputByteCount: vector.outputLength, rounds: vector.rounds, blockSize: vector.blockSize, parallelism: vector.parallelism) - + let DK2 = try KDF.Scrypt.deriveKey(from: discontiguousInput, salt: contiguousSalt, outputByteCount: vector.outputLength, rounds: vector.rounds, blockSize: vector.blockSize, parallelism: vector.parallelism) - + let DK3 = try KDF.Scrypt.deriveKey(from: contiguousInput, salt: discontiguousSalt, outputByteCount: vector.outputLength, rounds: vector.rounds, blockSize: vector.blockSize, parallelism: vector.parallelism) - + let DK4 = try KDF.Scrypt.deriveKey(from: discontiguousInput, salt: discontiguousSalt, outputByteCount: vector.outputLength, rounds: vector.rounds, blockSize: vector.blockSize, parallelism: vector.parallelism) - + let expectedDK = SymmetricKey(data: vector.derivedKey) XCTAssertEqual(DK1, expectedDK) XCTAssertEqual(DK2, expectedDK) XCTAssertEqual(DK3, expectedDK) XCTAssertEqual(DK4, expectedDK) } - + func testRFCVector(_ vector: RFCTestVector) throws { try oneshotTesting(vector) } - + func testRfcTestVectors() throws { var decoder = try orFail { try RFCVectorDecoder(bundleType: self, fileName: "rfc-7914-scrypt") } let vectors = try orFail { try decoder.decode([RFCTestVector].self) } - + for vector in vectors { try orFail { try self.testRFCVector(vector) } } diff --git a/Tests/_CryptoExtrasTests/TestRSABlindSigning.swift b/Tests/CryptoExtrasTests/TestRSABlindSigning.swift similarity index 99% rename from Tests/_CryptoExtrasTests/TestRSABlindSigning.swift rename to Tests/CryptoExtrasTests/TestRSABlindSigning.swift index fb6a9c32e..ceaca2d71 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: #filePath) )) } diff --git a/Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift b/Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift similarity index 96% rename from Tests/_CryptoExtrasTests/TestRSABlindSigningAPI.swift rename to Tests/CryptoExtrasTests/TestRSABlindSigningAPI.swift index 413d1855f..506999347 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 similarity index 99% rename from Tests/_CryptoExtrasTests/TestRSAEncryption.swift rename to Tests/CryptoExtrasTests/TestRSAEncryption.swift index b6d45c3b6..9a6325fad 100644 --- a/Tests/_CryptoExtrasTests/TestRSAEncryption.swift +++ b/Tests/CryptoExtrasTests/TestRSAEncryption.swift @@ -18,10 +18,10 @@ import Foundation #endif import XCTest import Crypto -import _CryptoExtras +import CryptoExtras final class TestRSAEncryption: XCTestCase { - + func test_wycheproofOAEPVectors() throws { try wycheproofTest( jsonName: "rsa_oaep_misc_test", @@ -33,11 +33,11 @@ final class TestRSAEncryption: XCTestCase { jsonName: "rsa_oaep_2048_sha256_mgf1sha256_test", testFunction: self.testOAEPGroup) } - + private func testOAEPGroup(_ group: RSAEncryptionOAEPTestGroup) throws { let derPrivKey: _RSA.Encryption.PrivateKey let pemPrivKey: _RSA.Encryption.PrivateKey - + if group.keysize < 2048 { derPrivKey = try _RSA.Encryption.PrivateKey(unsafeDERRepresentation: group.privateKeyDerBytes) pemPrivKey = try _RSA.Encryption.PrivateKey(unsafePEMRepresentation: group.privateKeyPem) @@ -60,7 +60,7 @@ final class TestRSAEncryption: XCTestCase { // We currently only support SHA-1, SHA-256. return } - + for test in group.tests { guard test.label?.isEmpty ?? true else { // We currently have no support for OAEP labels. @@ -77,7 +77,7 @@ final class TestRSAEncryption: XCTestCase { } catch { valid = false } - + XCTAssertEqual(valid, test.expectedValidity, "test number \(test.tcId) failed, expected \(test.result) but got \(valid)") } } @@ -129,7 +129,7 @@ final class TestRSAEncryption: XCTestCase { XCTAssertEqual(Data(data), decrypted) } } - + func testGetKeyPrimitives() throws { for testVector in RFC9474TestVector.allValues { let n = try Data(hexString: testVector.n) diff --git a/Tests/_CryptoExtrasTests/TestRSASigning.swift b/Tests/CryptoExtrasTests/TestRSASigning.swift similarity index 99% rename from Tests/_CryptoExtrasTests/TestRSASigning.swift rename to Tests/CryptoExtrasTests/TestRSASigning.swift index 7bbb2cf1a..64ca65f75 100644 --- a/Tests/_CryptoExtrasTests/TestRSASigning.swift +++ b/Tests/CryptoExtrasTests/TestRSASigning.swift @@ -19,7 +19,7 @@ import Foundation import XCTest import Crypto import CryptoBoringWrapper -@testable import _CryptoExtras +@testable import CryptoExtras final class TestRSASigning: XCTestCase { @@ -76,7 +76,7 @@ final class TestRSASigning: XCTestCase { try wycheproofTest( jsonName: "rsa_signature_test", testFunction: self.testPKCS1Group) - + try wycheproofTest( jsonName: "rsa_signature_2048_sha256_test", testFunction: self.testPKCS1Group) @@ -130,10 +130,10 @@ final class TestRSASigning: XCTestCase { func test_wycheproofPrimitives() throws { try wycheproofTest( - jsonName: "rsa_oaep_2048_sha1_mgf1sha1_test", + jsonName: "rsa_oaep_2048_sha1_mgf1sha1_test", testFunction: self.testPrimeFactors) try wycheproofTest( - jsonName: "rsa_oaep_2048_sha256_mgf1sha256_test", + jsonName: "rsa_oaep_2048_sha256_mgf1sha256_test", testFunction: self.testPrimeFactors) } @@ -352,12 +352,12 @@ final class TestRSASigning: XCTestCase { (_RSA.Signing.PrivateKey(keySize: .bits4096), 4096), (_RSA.Signing.PrivateKey(unsafeKeySize: .init(bitCount: 1024)), 1024), ] - + for (key, size) in keysAndSizes { XCTAssertEqual(size, key.keySizeInBits) XCTAssertEqual(size, key.publicKey.keySizeInBits) } - + try XCTAssertThrowsError((_RSA.Signing.PrivateKey(keySize: .init(bitCount: 1024)), 1024)) } @@ -734,7 +734,7 @@ final class TestRSASigning: XCTestCase { K8TpFCFPBP/Yv1Kngovn4O1MskoxTQraRBDjfC6O7OfcSCSMuVgB0Oofcp9iQjLA HV3KOnbYqvzmFv7OWnAszkTh -----END PRIVATE KEY----- - + """ let key = try _RSA.Signing.PrivateKey(pemRepresentation: pemKey) @@ -803,7 +803,7 @@ final class TestRSASigning: XCTestCase { private func testPKCS1Group(_ group: RSAPKCS1TestGroup) throws { let derKey: _RSA.Signing.PublicKey let pemKey: _RSA.Signing.PublicKey - + if group.keysize < 2048 { derKey = try _RSA.Signing.PublicKey(unsafeDERRepresentation: group.keyDerBytes) pemKey = try _RSA.Signing.PublicKey(unsafePEMRepresentation: group.keyPem) diff --git a/Tests/_CryptoExtrasTests/Util/IntegerEncodingTests.swift b/Tests/CryptoExtrasTests/Util/IntegerEncodingTests.swift similarity index 99% rename from Tests/_CryptoExtrasTests/Util/IntegerEncodingTests.swift rename to Tests/CryptoExtrasTests/Util/IntegerEncodingTests.swift index 1d161300e..c90360dba 100644 --- a/Tests/_CryptoExtrasTests/Util/IntegerEncodingTests.swift +++ b/Tests/CryptoExtrasTests/Util/IntegerEncodingTests.swift @@ -11,7 +11,7 @@ // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest final class IntegerEncodingTests: XCTestCase { 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 97% rename from Tests/_CryptoExtrasTests/Utils/RFCVector.swift rename to Tests/CryptoExtrasTests/Utils/RFCVector.swift index bc6748989..e7701f85d 100644 --- a/Tests/_CryptoExtrasTests/Utils/RFCVector.swift +++ b/Tests/CryptoExtrasTests/Utils/RFCVector.swift @@ -31,14 +31,14 @@ struct RFCVectorDecoder { } #if compiler(>=6.0) if #available(macOS 13, iOS 16, watchOS 9, tvOS 16, visionOS 1, macCatalyst 16, *) { - fileURL!.append(path: "_CryptoExtrasVectors", directoryHint: .isDirectory) + fileURL!.append(path: "CryptoExtrasVectors", directoryHint: .isDirectory) fileURL!.append(path: "\(fileName).txt", directoryHint: .notDirectory) } else { - fileURL! = fileURL!.appendingPathComponent("_CryptoExtrasVectors", isDirectory: true) + fileURL! = fileURL!.appendingPathComponent("CryptoExtrasVectors", isDirectory: true) fileURL! = fileURL!.appendingPathComponent("\(fileName).txt", isDirectory: false) } #else - fileURL! = fileURL!.appendingPathComponent("_CryptoExtrasVectors", isDirectory: true) + fileURL! = fileURL!.appendingPathComponent("CryptoExtrasVectors", isDirectory: true) fileURL! = fileURL!.appendingPathComponent("\(fileName).txt", isDirectory: false) #endif @@ -82,7 +82,7 @@ extension RFCVectorDecoder: Decoder { return [] } - + var userInfo: [CodingUserInfoKey: Any] { return [:] } func container(keyedBy type: Key.Type) throws -> KeyedDecodingContainer where Key: CodingKey { 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 85% rename from Tests/_CryptoExtrasTests/Utils/Wycheproof.swift rename to Tests/CryptoExtrasTests/Utils/Wycheproof.swift index 9c7025617..065f8ff6a 100644 --- a/Tests/_CryptoExtrasTests/Utils/Wycheproof.swift +++ b/Tests/CryptoExtrasTests/Utils/Wycheproof.swift @@ -27,14 +27,14 @@ extension XCTestCase { } #if compiler(>=6.0) if #available(macOS 13, iOS 16, watchOS 9, tvOS 16, visionOS 1, macCatalyst 16, *) { - fileURL.append(path: "_CryptoExtrasVectors", directoryHint: .isDirectory) + fileURL.append(path: "CryptoExtrasVectors", directoryHint: .isDirectory) fileURL.append(path: "\(jsonName).json", directoryHint: .notDirectory) } else { - fileURL = fileURL.appendingPathComponent("_CryptoExtrasVectors", isDirectory: true) + fileURL = fileURL.appendingPathComponent("CryptoExtrasVectors", isDirectory: true) fileURL = fileURL.appendingPathComponent("\(jsonName).json", isDirectory: false) } #else - fileURL = fileURL.appendingPathComponent("_CryptoExtrasVectors", isDirectory: true) + fileURL = fileURL.appendingPathComponent("CryptoExtrasVectors", isDirectory: true) fileURL = fileURL.appendingPathComponent("\(jsonName).json", isDirectory: false) #endif diff --git a/Tests/_CryptoExtrasTests/Utils/XCTestUtils.swift b/Tests/CryptoExtrasTests/Utils/XCTestUtils.swift similarity index 100% rename from Tests/_CryptoExtrasTests/Utils/XCTestUtils.swift rename to Tests/CryptoExtrasTests/Utils/XCTestUtils.swift diff --git a/Tests/_CryptoExtrasTests/ZKPs/ZKPToolbox.swift b/Tests/CryptoExtrasTests/ZKPs/ZKPToolbox.swift similarity index 99% rename from Tests/_CryptoExtrasTests/ZKPs/ZKPToolbox.swift rename to Tests/CryptoExtrasTests/ZKPs/ZKPToolbox.swift index 67a767606..d391006de 100644 --- a/Tests/_CryptoExtrasTests/ZKPs/ZKPToolbox.swift +++ b/Tests/CryptoExtrasTests/ZKPs/ZKPToolbox.swift @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// import Crypto -@testable import _CryptoExtras +@testable import CryptoExtras import XCTest @available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *) 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_cmac_test.json b/Tests/CryptoExtrasVectors/aes_cmac_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/aes_cmac_test.json rename to Tests/CryptoExtrasVectors/aes_cmac_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/mldsa_65_verify_test.json b/Tests/CryptoExtrasVectors/mldsa_65_verify_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/mldsa_65_verify_test.json rename to Tests/CryptoExtrasVectors/mldsa_65_verify_test.json diff --git a/Tests/_CryptoExtrasVectors/mldsa_87_verify_test.json b/Tests/CryptoExtrasVectors/mldsa_87_verify_test.json similarity index 100% rename from Tests/_CryptoExtrasVectors/mldsa_87_verify_test.json rename to Tests/CryptoExtrasVectors/mldsa_87_verify_test.json diff --git a/Tests/_CryptoExtrasVectors/mldsa_nist_keygen_65_tests.json b/Tests/CryptoExtrasVectors/mldsa_nist_keygen_65_tests.json similarity index 100% rename from Tests/_CryptoExtrasVectors/mldsa_nist_keygen_65_tests.json rename to Tests/CryptoExtrasVectors/mldsa_nist_keygen_65_tests.json diff --git a/Tests/_CryptoExtrasVectors/mldsa_nist_keygen_87_tests.json b/Tests/CryptoExtrasVectors/mldsa_nist_keygen_87_tests.json similarity index 100% rename from Tests/_CryptoExtrasVectors/mldsa_nist_keygen_87_tests.json rename to Tests/CryptoExtrasVectors/mldsa_nist_keygen_87_tests.json diff --git a/Tests/_CryptoExtrasVectors/rfc-6070-PBKDF2-SHA1.txt b/Tests/CryptoExtrasVectors/rfc-6070-PBKDF2-SHA1.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/rfc-6070-PBKDF2-SHA1.txt rename to Tests/CryptoExtrasVectors/rfc-6070-PBKDF2-SHA1.txt diff --git a/Tests/_CryptoExtrasVectors/rfc-7914-scrypt.txt b/Tests/CryptoExtrasVectors/rfc-7914-scrypt.txt similarity index 100% rename from Tests/_CryptoExtrasVectors/rfc-7914-scrypt.txt rename to Tests/CryptoExtrasVectors/rfc-7914-scrypt.txt 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 diff --git a/scripts/gyb b/scripts/gyb index ef8021ad4..3c5129632 100755 --- a/scripts/gyb +++ b/scripts/gyb @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python import gyb gyb.main()