From 57782dc6667d0c7e25ef67e0c4ce137d9781ef48 Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 11 Aug 2026 15:30:28 +0100 Subject: [PATCH] [5.x] Remove duplicate imports from gyb-generated MLDSA backend code (#458) ### Motivation The `MLDSA_boring.swift` backend had a bunch of repeated import statements. These exist in the gyb too. ### Modifications - Remove duplicate import statements from `MLDSA_boring.swift.gyb`. - Regenerate `MLDSA_boring.swift` from gyb. ### Result - Duplicate imports removed from `MLDSA_boring.swift`. - Aligns more closely with `MLKEM_boring.swift`, which didn't have this problem it its code or gyb. --- .../Signatures/BoringSSL/MLDSA_boring.swift | 17 +++-------------- .../Signatures/BoringSSL/MLDSA_boring.swift.gyb | 17 +++-------------- 2 files changed, 6 insertions(+), 28 deletions(-) diff --git a/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift b/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift index 7429d72a..412ed1ac 100644 --- a/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift +++ b/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift @@ -12,24 +12,13 @@ // //===----------------------------------------------------------------------===// -#if canImport(CryptoKit) -@_exported import CryptoKit -#else -#if hasFeature(SourceWarningControl) -@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL -#else -@_implementationOnly import CCryptoBoringSSL -#endif -#if canImport(FoundationEssentials) -import FoundationEssentials -#else -import Foundation -#endif - // MARK: - Generated file, do NOT edit // any edits of this file WILL be overwritten and thus discarded // see section `gyb` in `README` for details. +#if canImport(CryptoKit) +@_exported import CryptoKit +#else #if hasFeature(SourceWarningControl) @diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL #else diff --git a/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift.gyb b/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift.gyb index 6b73db93..62891ac6 100644 --- a/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift.gyb +++ b/Sources/Crypto/Signatures/BoringSSL/MLDSA_boring.swift.gyb @@ -12,24 +12,13 @@ // //===----------------------------------------------------------------------===// -#if canImport(CryptoKit) -@_exported import CryptoKit -#else -#if hasFeature(SourceWarningControl) -@diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL -#else -@_implementationOnly import CCryptoBoringSSL -#endif -#if canImport(FoundationEssentials) -import FoundationEssentials -#else -import Foundation -#endif - // MARK: - Generated file, do NOT edit // any edits of this file WILL be overwritten and thus discarded // see section `gyb` in `README` for details. +#if canImport(CryptoKit) +@_exported import CryptoKit +#else #if hasFeature(SourceWarningControl) @diagnose(ImplementationOnlyDeprecated, as: ignored) @_implementationOnly import CCryptoBoringSSL #else