From e8db9a791f20e920f1e00fd5e7afeb4ba5a2b7b6 Mon Sep 17 00:00:00 2001 From: Fabian Boemer Date: Fri, 27 Sep 2024 14:52:10 -0700 Subject: [PATCH] Neighbors -> Neighbor in PNNS (#115) --- .pre-commit-config.yaml | 2 +- .spi.yml | 4 +-- ...ivateNearestNeighborSearchBenchmark.swift} | 6 ++-- Package.resolved | 6 ++-- Package.swift | 36 +++++++++---------- README.md | 14 ++++---- .../HomomorphicEncryption.md | 4 +-- ...orphic_encryption_v1_error_stddev.pb.swift | 2 +- ...wift_homomorphic_encryption_v1_he.pb.swift | 1 + .../GenerateDatabase.swift | 4 +-- .../PNNSGenerateDatabase.md | 2 +- .../PNNSProcessDatabase.md | 2 +- .../PNNSProcessDatabase/ProcessDatabase.swift | 4 +-- ...morphic_encryption_api_pir_v1_api.pb.swift | 1 + ...morphic_encryption_api_pir_v1_pir.pb.swift | 1 + ...cryption_api_shared_v1_api_shared.pb.swift | 1 + ...homomorphic_encryption_pir_v1_pir.pb.swift | 2 +- ...c_encryption_pir_v1_pir_algorithm.pb.swift | 2 +- ...ic_encryption_pir_v1_pir_database.pb.swift | 1 + .../CiphertextMatrix.swift | 0 .../Client.swift | 6 ++-- .../Config.swift | 6 ++-- .../Database.swift | 6 ++-- .../Error.swift | 4 +-- .../MatrixMultiplication.swift | 0 .../PlaintextMatrix.swift | 0 .../PnnsProtocol.swift | 0 .../PrivateNearestNeighborSearch.md} | 6 ++-- .../ProcessedDatabase.swift | 2 +- .../SerializedCiphertextMatrix.swift | 0 .../SerializedPlaintextMatrix.swift | 0 .../Server.swift | 4 +-- .../Util.swift | 0 .../ConversionApi.swift | 2 +- .../ConversionError.swift | 0 .../ConversionPnns.swift | 2 +- .../PrivateNearestNeighborSearch.md | 11 ++++++ .../generated/README.md | 0 ...orphic_encryption_api_pnns_v1_api.pb.swift | 1 + ...rphic_encryption_api_pnns_v1_pnns.pb.swift | 1 + ...cryption_api_shared_v1_api_shared.pb.swift | 1 + ...momorphic_encryption_pnns_v1_pnns.pb.swift | 2 +- ...yption_pnns_v1_pnns_client_config.pb.swift | 2 +- ..._encryption_pnns_v1_pnns_database.pb.swift | 1 + ...tion_pnns_v1_pnns_distance_metric.pb.swift | 2 +- ...ption_pnns_v1_pnns_matrix_packing.pb.swift | 2 +- ...n_pnns_v1_pnns_processed_database.pb.swift | 1 + ...yption_pnns_v1_pnns_server_config.pb.swift | 2 +- .../protobuf_module_mappings.txtpb | 0 .../PrivateNearestNeighborsSearch.md | 11 ------ .../ConversionTests.swift | 4 +-- .../CiphertextMatrixTests.swift | 2 +- .../ClientTests.swift | 2 +- .../CosineSimilarityTests.swift | 2 +- .../DatabaseTests.swift | 2 +- .../MatrixMultiplicationTests.swift | 2 +- .../PlaintextMatrixTests.swift | 2 +- .../Utils.swift | 2 +- .../UtilsTests.swift | 2 +- Utilities/generate-protobuf-files.sh | 10 +++--- swift-homomorphic-encryption-protobuf | 2 +- 61 files changed, 106 insertions(+), 96 deletions(-) rename Benchmarks/{PrivateNearestNeighborsSearchBenchmark/PrivateNearestNeighborsSearchBenchmark.swift => PrivateNearestNeighborSearchBenchmark/PrivateNearestNeighborSearchBenchmark.swift} (99%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/CiphertextMatrix.swift (100%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Client.swift (98%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Config.swift (97%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Database.swift (90%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Error.swift (97%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/MatrixMultiplication.swift (100%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/PlaintextMatrix.swift (100%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/PnnsProtocol.swift (100%) rename Sources/{PrivateNearestNeighborsSearch/PrivateNearestNeighborsSearch.docc/PrivateNearestNeighborsSearch.md => PrivateNearestNeighborSearch/PrivateNearestNeighborSearch.docc/PrivateNearestNeighborSearch.md} (79%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/ProcessedDatabase.swift (99%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/SerializedCiphertextMatrix.swift (100%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/SerializedPlaintextMatrix.swift (100%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Server.swift (96%) rename Sources/{PrivateNearestNeighborsSearch => PrivateNearestNeighborSearch}/Util.swift (100%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/ConversionApi.swift (98%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/ConversionError.swift (100%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/ConversionPnns.swift (99%) create mode 100644 Sources/PrivateNearestNeighborSearchProtobuf/PrivateNearestNeighborSearchProtobuf.docc/PrivateNearestNeighborSearch.md rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/README.md (100%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift (99%) rename Sources/{PrivateNearestNeighborsSearchProtobuf => PrivateNearestNeighborSearchProtobuf}/protobuf_module_mappings.txtpb (100%) delete mode 100644 Sources/PrivateNearestNeighborsSearchProtobuf/PrivateNearestNeighborsSearchProtobuf.docc/PrivateNearestNeighborsSearch.md rename Tests/{PrivateNearestNeighborsSearchProtobufTests => PrivateNearestNeighborSearchProtobufTests}/ConversionTests.swift (99%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/CiphertextMatrixTests.swift (99%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/ClientTests.swift (99%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/CosineSimilarityTests.swift (98%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/DatabaseTests.swift (98%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/MatrixMultiplicationTests.swift (99%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/PlaintextMatrixTests.swift (99%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/Utils.swift (98%) rename Tests/{PrivateNearestNeighborsSearchTests => PrivateNearestNeighborSearchTests}/UtilsTests.swift (98%) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b586d3f1..30478238 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: - // - --allow-past-years - --use-current-year - - --detect-license-in-X-top-lines=10 + - --detect-license-in-X-top-lines=11 - id: insert-license name: insert-license-yaml 'types_or': [yaml] diff --git a/.spi.yml b/.spi.yml index 2524ca24..2bcede2a 100644 --- a/.spi.yml +++ b/.spi.yml @@ -25,6 +25,6 @@ builder: - PNNSProcessDatabase - PrivateInformationRetrieval - PrivateInformationRetrievalProtobuf - - PrivateNearestNeighborsSearch - - PrivateNearestNeighborsSearchProtobuf + - PrivateNearestNeighborSearch + - PrivateNearestNeighborSearchProtobuf swift_version: 6.0 diff --git a/Benchmarks/PrivateNearestNeighborsSearchBenchmark/PrivateNearestNeighborsSearchBenchmark.swift b/Benchmarks/PrivateNearestNeighborSearchBenchmark/PrivateNearestNeighborSearchBenchmark.swift similarity index 99% rename from Benchmarks/PrivateNearestNeighborsSearchBenchmark/PrivateNearestNeighborsSearchBenchmark.swift rename to Benchmarks/PrivateNearestNeighborSearchBenchmark/PrivateNearestNeighborSearchBenchmark.swift index 3b92f0d7..6d4deb8b 100644 --- a/Benchmarks/PrivateNearestNeighborsSearchBenchmark/PrivateNearestNeighborsSearchBenchmark.swift +++ b/Benchmarks/PrivateNearestNeighborSearchBenchmark/PrivateNearestNeighborSearchBenchmark.swift @@ -19,8 +19,8 @@ import Benchmark import Foundation import HomomorphicEncryption import HomomorphicEncryptionProtobuf -import PrivateNearestNeighborsSearch -import PrivateNearestNeighborsSearchProtobuf +import PrivateNearestNeighborSearch +import PrivateNearestNeighborSearchProtobuf @usableFromInline nonisolated(unsafe) let benchmarkConfiguration = Benchmark.Configuration( metrics: [ @@ -93,7 +93,7 @@ extension EncryptionParameters { let noiseBudgetScale = 10 -extension PrivateNearestNeighborsSearch.Response { +extension PrivateNearestNeighborSearch.Response { func scaledNoiseBudget(using secretKey: Scheme.SecretKey) throws -> Int { try Int( noiseBudget(using: secretKey, variableTime: true) * Double( diff --git a/Package.resolved b/Package.resolved index 5f76b2f5..8a26fe6d 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "924e29f4ba35b567344548cae01b03bc8f2c3a884de7a16bcd7dc8475e890dfb", + "originHash" : "35058120a76c9add338a72688983f31eb5403042763150a08ca6e53652580567", "pins" : [ { "identity" : "hdrhistogram-swift", @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf", "state" : { - "revision" : "d57a5aecf24a25b32ec4a74be2f5d0a995a47c4b", - "version" : "1.27.0" + "revision" : "edb6ed4919f7756157fe02f2552b7e3850a538e5", + "version" : "1.28.1" } }, { diff --git a/Package.swift b/Package.swift index b4b0ba5b..0f1c451f 100644 --- a/Package.swift +++ b/Package.swift @@ -42,11 +42,11 @@ let package = Package( name: "PrivateInformationRetrievalProtobuf", targets: ["PrivateInformationRetrievalProtobuf"]), .library( - name: "PrivateNearestNeighborsSearch", - targets: ["PrivateNearestNeighborsSearch"]), + name: "PrivateNearestNeighborSearch", + targets: ["PrivateNearestNeighborSearch"]), .library( - name: "PrivateNearestNeighborsSearchProtobuf", - targets: ["PrivateNearestNeighborsSearchProtobuf"]), + name: "PrivateNearestNeighborSearchProtobuf", + targets: ["PrivateNearestNeighborSearchProtobuf"]), .executable(name: "PIRGenerateDatabase", targets: ["PIRGenerateDatabase"]), .executable(name: "PIRProcessDatabase", targets: ["PIRProcessDatabase"]), .executable(name: "PIRShardDatabase", targets: ["PIRShardDatabase"]), @@ -59,7 +59,7 @@ let package = Package( .package(url: "https://github.com/apple/swift-crypto.git", from: "3.4.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), .package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"), - .package(url: "https://github.com/apple/swift-protobuf", from: "1.27.0"), // Keep version in sync with README + .package(url: "https://github.com/apple/swift-protobuf", from: "1.28.1"), // Keep version in sync with README .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"), ], targets: [ @@ -99,15 +99,15 @@ let package = Package( exclude: ["generated/README.md", "protobuf_module_mappings.txtpb"], swiftSettings: librarySettings), .target( - name: "PrivateNearestNeighborsSearch", + name: "PrivateNearestNeighborSearch", dependencies: [ .product(name: "Algorithms", package: "swift-algorithms"), "HomomorphicEncryption", ], swiftSettings: librarySettings), .target( - name: "PrivateNearestNeighborsSearchProtobuf", - dependencies: ["PrivateNearestNeighborsSearch", + name: "PrivateNearestNeighborSearchProtobuf", + dependencies: ["PrivateNearestNeighborSearch", "HomomorphicEncryption", "HomomorphicEncryptionProtobuf", .product(name: "SwiftProtobuf", package: "swift-protobuf")], @@ -151,7 +151,7 @@ let package = Package( dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), "HomomorphicEncryption", - "PrivateNearestNeighborsSearchProtobuf", + "PrivateNearestNeighborSearchProtobuf", ], swiftSettings: executableSettings), .executableTarget( @@ -159,7 +159,7 @@ let package = Package( dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), "HomomorphicEncryptionProtobuf", - "PrivateNearestNeighborsSearchProtobuf", + "PrivateNearestNeighborSearchProtobuf", "HomomorphicEncryption", .product(name: "Logging", package: "swift-log"), ], @@ -201,15 +201,15 @@ let package = Package( "TestUtilities", ], swiftSettings: executableSettings), .testTarget( - name: "PrivateNearestNeighborsSearchTests", + name: "PrivateNearestNeighborSearchTests", dependencies: [ - "PrivateNearestNeighborsSearch", "HomomorphicEncryption", "TestUtilities", + "PrivateNearestNeighborSearch", "HomomorphicEncryption", "TestUtilities", ], swiftSettings: executableSettings), .testTarget( - name: "PrivateNearestNeighborsSearchProtobufTests", + name: "PrivateNearestNeighborSearchProtobufTests", dependencies: [ - "PrivateNearestNeighborsSearch", - "PrivateNearestNeighborsSearchProtobuf", + "PrivateNearestNeighborSearch", + "PrivateNearestNeighborSearchProtobuf", ], swiftSettings: executableSettings), ]) @@ -261,10 +261,10 @@ package.targets += [ .product(name: "Benchmark", package: "package-benchmark"), "HomomorphicEncryption", "HomomorphicEncryptionProtobuf", - "PrivateNearestNeighborsSearch", - "PrivateNearestNeighborsSearchProtobuf", + "PrivateNearestNeighborSearch", + "PrivateNearestNeighborSearchProtobuf", ], - path: "Benchmarks/PrivateNearestNeighborsSearchBenchmark", + path: "Benchmarks/PrivateNearestNeighborSearchBenchmark", swiftSettings: benchmarkSettings, plugins: [ .plugin(name: "BenchmarkPlugin", package: "package-benchmark"), diff --git a/README.md b/README.md index 1d8a14c9..99ff966c 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@ For more information, refer to documentation for the libraries: * [HomomorphicEncryption](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/homomorphicencryption) * [PrivateInformationRetrievalProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privateinformationretrievalprotobuf) * [PrivateInformationRetrieval](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privateinformationretrieval) -* [PrivateNearestNeighborsSearchProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearchprotobuf) -* [PrivateNearestNeighborsSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearch) +* [PrivateNearestNeighborSearchProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearchprotobuf) +* [PrivateNearestNeighborSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearch) and executables: * [PIRGenerateDatabase](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/pirgeneratedatabase) @@ -63,11 +63,11 @@ The PIR implementation in Swift Homomorphic Encryption uses HE to improve upon t > PIR is asymmetric, meaning the client may learn keyword-value pairs not requested, as happens in trivial PIR for instance. > A variant of PIR, known as *symmetric PIR*, would be required to ensure the client does not learn anything about values it did not request. -### Private Nearest Neighbors Search (PNNS) -Private nearest neighbors search (PNNS) enables a client with a private vector to search for the nearest vectors in a database hosted by a server, *without the server learning the client's vector.*. +### Private Nearest Neighbor Search (PNNS) +Private nearest neighbor search (PNNS) enables a client with a private vector to search for the nearest vectors in a database hosted by a server, *without the server learning the client's vector.*. Each row in the database is a *vector* with an associated *entry identifier* and *entry metadata*. -During the PNNS protocol, the client issues a query using its private vector, and learns the nearest neighbors according to a ``DistanceMetric``. -Specifically, the client learns the distances between the client's query vector to the nearest neighbors, as well as the entry identifier and entry metadata of the nearest neighbors. +During the PNNS protocol, the client issues a query using its private vector, and learns the nearest neighbor according to a ``DistanceMetric``. +Specifically, the client learns the distances between the client's query vector to the nearest neighbor, as well as the entry identifier and entry metadata of the nearest neighbor. A trivial implementation of PNNS is to have the client issue a generic "fetch database" request, independent of its private vector. Then the server sends the entire database to the client, who computes the distances locally. @@ -141,7 +141,7 @@ Additionally, developing Swift Homomorphic Encryption requires: * [Nick Lockwood SwiftFormat](https://github.com/nicklockwood/SwiftFormat), v0.54.0 * [pre-commit](https://pre-commit.com) * [swift-format](https://github.com/apple/swift-format), v510.1.0 -* [swift-protobuf](https://github.com/apple/swift-protobuf), v1.27.0 +* [swift-protobuf](https://github.com/apple/swift-protobuf), v1.28.1 * [SwiftLint](https://github.com/realm/SwiftLint), v0.55.1 ### Building diff --git a/Sources/HomomorphicEncryption/HomomorphicEncryption.docc/HomomorphicEncryption.md b/Sources/HomomorphicEncryption/HomomorphicEncryption.docc/HomomorphicEncryption.md index 5b4efb50..0952cae6 100644 --- a/Sources/HomomorphicEncryption/HomomorphicEncryption.docc/HomomorphicEncryption.md +++ b/Sources/HomomorphicEncryption/HomomorphicEncryption.docc/HomomorphicEncryption.md @@ -9,8 +9,8 @@ For more information, refer to documentation for the libraries: * [HomomorphicEncryption](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/homomorphicencryption) * [PrivateInformationRetrievalProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privateinformationretrievalprotobuf) * [PrivateInformationRetrieval](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privateinformationretrieval) -* [PrivateNearestNeighborsSearchProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearchprotobuf) -* [PrivateNearestNeighborsSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearch) +* [PrivateNearestNeighborSearchProtobuf](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearchprotobuf) +* [PrivateNearestNeighborSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearch) and executables: * [PIRGenerateDatabase](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/pirgeneratedatabase) diff --git a/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_error_stddev.pb.swift b/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_error_stddev.pb.swift index 126bf13e..cce40cc4 100644 --- a/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_error_stddev.pb.swift +++ b/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_error_stddev.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/v1/error_stddev.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file diff --git a/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_he.pb.swift b/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_he.pb.swift index 567f87eb..73d0e048 100644 --- a/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_he.pb.swift +++ b/Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_he.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/v1/he.proto diff --git a/Sources/PNNSGenerateDatabase/GenerateDatabase.swift b/Sources/PNNSGenerateDatabase/GenerateDatabase.swift index 1cd85190..1b981e42 100644 --- a/Sources/PNNSGenerateDatabase/GenerateDatabase.swift +++ b/Sources/PNNSGenerateDatabase/GenerateDatabase.swift @@ -15,8 +15,8 @@ import ArgumentParser import Foundation import HomomorphicEncryption -import PrivateNearestNeighborsSearch -import PrivateNearestNeighborsSearchProtobuf +import PrivateNearestNeighborSearch +import PrivateNearestNeighborSearchProtobuf enum VectorTypeArguments: String, CaseIterable, ExpressibleByArgument { /// Each vector's entry is uniform random from `[-1.0, 1.0]` diff --git a/Sources/PNNSGenerateDatabase/PNNSGenerateDatabase.docc/PNNSGenerateDatabase.md b/Sources/PNNSGenerateDatabase/PNNSGenerateDatabase.docc/PNNSGenerateDatabase.md index d138ff19..6b8e2762 100644 --- a/Sources/PNNSGenerateDatabase/PNNSGenerateDatabase.docc/PNNSGenerateDatabase.md +++ b/Sources/PNNSGenerateDatabase/PNNSGenerateDatabase.docc/PNNSGenerateDatabase.md @@ -1,6 +1,6 @@ # ``PNNSGenerateDatabase`` -Private Nearest Neighbors Search database generation +Private Nearest Neighbor Search database generation ## Overview diff --git a/Sources/PNNSProcessDatabase/PNNSProcessDatabase.docc/PNNSProcessDatabase.md b/Sources/PNNSProcessDatabase/PNNSProcessDatabase.docc/PNNSProcessDatabase.md index 739e63d9..79620d0d 100644 --- a/Sources/PNNSProcessDatabase/PNNSProcessDatabase.docc/PNNSProcessDatabase.md +++ b/Sources/PNNSProcessDatabase/PNNSProcessDatabase.docc/PNNSProcessDatabase.md @@ -1,6 +1,6 @@ # ``PNNSProcessDatabase`` -Private Nearest Neighbors Search database processing +Private Nearest Neighbor Search database processing ## Overview PNNS database processing will transform a database in preparation for hosting PNNS queries. diff --git a/Sources/PNNSProcessDatabase/ProcessDatabase.swift b/Sources/PNNSProcessDatabase/ProcessDatabase.swift index 76c78ec4..cd9e1458 100644 --- a/Sources/PNNSProcessDatabase/ProcessDatabase.swift +++ b/Sources/PNNSProcessDatabase/ProcessDatabase.swift @@ -30,8 +30,8 @@ import ArgumentParser import Foundation import HomomorphicEncryption import Logging -import PrivateNearestNeighborsSearch -import PrivateNearestNeighborsSearchProtobuf +import PrivateNearestNeighborSearch +import PrivateNearestNeighborSearchProtobuf /// Creates a new `Database` from a given path. /// - Parameter path: The path to the `Database` file. diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_api.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_api.pb.swift index a3693568..bef234b7 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_api.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_api.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/pir/v1/api.proto diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_pir.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_pir.pb.swift index 0fa56413..4be5c1f8 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_pir.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_pir.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/pir/v1/pir.proto diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift index a2b55397..ee9e224e 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/shared/v1/api_shared.proto diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir.pb.swift index 52498adc..e7630c3a 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pir/v1/pir.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf import HomomorphicEncryptionProtobuf diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_algorithm.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_algorithm.pb.swift index a93fa569..02f6f63c 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_algorithm.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_algorithm.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pir/v1/pir_algorithm.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file diff --git a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_database.pb.swift b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_database.pb.swift index 3521ed58..aeebe025 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_database.pb.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_database.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pir/v1/pir_database.proto diff --git a/Sources/PrivateNearestNeighborsSearch/CiphertextMatrix.swift b/Sources/PrivateNearestNeighborSearch/CiphertextMatrix.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/CiphertextMatrix.swift rename to Sources/PrivateNearestNeighborSearch/CiphertextMatrix.swift diff --git a/Sources/PrivateNearestNeighborsSearch/Client.swift b/Sources/PrivateNearestNeighborSearch/Client.swift similarity index 98% rename from Sources/PrivateNearestNeighborsSearch/Client.swift rename to Sources/PrivateNearestNeighborSearch/Client.swift index 1a2fd790..7491c43e 100644 --- a/Sources/PrivateNearestNeighborsSearch/Client.swift +++ b/Sources/PrivateNearestNeighborSearch/Client.swift @@ -15,7 +15,7 @@ import Foundation import HomomorphicEncryption -/// Private nearest neighbors client. +/// Private nearest neighbor search client. public struct Client { /// Configuration. public let config: ClientConfig @@ -87,7 +87,7 @@ public struct Client { return Query(ciphertextMatrices: matrices) } - /// Decrypts a nearest neighbors search response. + /// Decrypts a nearest neighbor search response. /// - Parameters: /// - response: The response. /// - secretKey: Secret key to decrypt with. @@ -131,7 +131,7 @@ public struct Client { try contexts[0].generateSecretKey() } - /// Generates an `EvaluationKey` for use in nearest neighbors search. + /// Generates an `EvaluationKey` for use in nearest neighbor search. /// - Parameter secretKey: Secret key used to generate the evaluation key. /// - Returns: The evaluation key. /// - Throws: Error upon failure to generate the evaluation key. diff --git a/Sources/PrivateNearestNeighborsSearch/Config.swift b/Sources/PrivateNearestNeighborSearch/Config.swift similarity index 97% rename from Sources/PrivateNearestNeighborsSearch/Config.swift rename to Sources/PrivateNearestNeighborSearch/Config.swift index 5885c547..eaf651d0 100644 --- a/Sources/PrivateNearestNeighborsSearch/Config.swift +++ b/Sources/PrivateNearestNeighborSearch/Config.swift @@ -54,7 +54,7 @@ public struct ClientConfig: Codable, Equatable, Hashable, Send public let queryPacking: MatrixPacking /// Number of entries in each vector. public let vectorDimension: Int - /// Evaluation key configuration for nearest neighbors computation. + /// Evaluation key configuration for nearest neighbor search. public let evaluationKeyConfig: EvaluationKeyConfig /// Metric for distances between vectors. public let distanceMetric: DistanceMetric @@ -72,8 +72,8 @@ public struct ClientConfig: Codable, Equatable, Hashable, Send /// - scalingFactor: Factor by which to scale floating-point entries before rounding to integers. /// - queryPacking: Packing for the query. /// - vectorDimension: Number of entries in each vector. - /// - evaluationKeyConfig: Evaluation key configuration for nearest neighbors computation. - /// - distanceMetric: Metric for nearest neighbors computation + /// - evaluationKeyConfig: Evaluation key configuration for nearest neighbor search. + /// - distanceMetric: Metric for nearest neighbor search. /// - extraPlaintextModuli: For plaintext CRT, the list of extra plaintext moduli. The first plaintext modulus /// will be the one in ``ClientConfig/encryptionParameters``. /// - Throws: Error upon failure to create a new client config. diff --git a/Sources/PrivateNearestNeighborsSearch/Database.swift b/Sources/PrivateNearestNeighborSearch/Database.swift similarity index 90% rename from Sources/PrivateNearestNeighborsSearch/Database.swift rename to Sources/PrivateNearestNeighborSearch/Database.swift index 8fec214b..16412b26 100644 --- a/Sources/PrivateNearestNeighborsSearch/Database.swift +++ b/Sources/PrivateNearestNeighborSearch/Database.swift @@ -20,14 +20,14 @@ public struct DatabaseRow: Codable, Equatable, Hashable, Sendable { /// Metadata associated with the entry. public let entryMetadata: [UInt8] - /// Vector for use in nearest neighbors computation. + /// Vector for use in nearest neighbor search. public let vector: [Float] /// Creates a new ``DatabaseRow``. /// - Parameters: /// - entryId: Unique identifier for the database entry. /// - entryMetadata: Metadata associated with the entry. - /// - vector: Vector for use in nearest neighbors computation + /// - vector: Vector for use in nearest neighbor search. public init(entryId: UInt64, entryMetadata: [UInt8], vector: [Float]) { self.entryId = entryId self.entryMetadata = entryMetadata @@ -35,7 +35,7 @@ public struct DatabaseRow: Codable, Equatable, Hashable, Sendable { } } -/// Database for nearest-neighbor search. +/// Database for nearest neighbor search. public struct Database: Codable, Equatable, Hashable, Sendable { /// Rows in the database. public let rows: [DatabaseRow] diff --git a/Sources/PrivateNearestNeighborsSearch/Error.swift b/Sources/PrivateNearestNeighborSearch/Error.swift similarity index 97% rename from Sources/PrivateNearestNeighborsSearch/Error.swift rename to Sources/PrivateNearestNeighborSearch/Error.swift index e03faad6..3531b3a7 100644 --- a/Sources/PrivateNearestNeighborsSearch/Error.swift +++ b/Sources/PrivateNearestNeighborSearch/Error.swift @@ -15,7 +15,7 @@ import Foundation import HomomorphicEncryption -/// Reeasons for an invalid ``PrivateNearestNeighborsSearch`` query. +/// Reeasons for an invalid ``PrivateNearestNeighborSearch`` query. public enum InvalidQueryReason: Error, Equatable { case wrongCiphertextMatrixCount(got: Int, expected: Int) } @@ -29,7 +29,7 @@ extension InvalidQueryReason: LocalizedError { } } -/// Error type for ``PrivateNearestNeighborsSearch``. +/// Error type for ``PrivateNearestNeighborSearch``. public enum PnnsError: Error, Equatable { case emptyCiphertextArray case emptyDatabase diff --git a/Sources/PrivateNearestNeighborsSearch/MatrixMultiplication.swift b/Sources/PrivateNearestNeighborSearch/MatrixMultiplication.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/MatrixMultiplication.swift rename to Sources/PrivateNearestNeighborSearch/MatrixMultiplication.swift diff --git a/Sources/PrivateNearestNeighborsSearch/PlaintextMatrix.swift b/Sources/PrivateNearestNeighborSearch/PlaintextMatrix.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/PlaintextMatrix.swift rename to Sources/PrivateNearestNeighborSearch/PlaintextMatrix.swift diff --git a/Sources/PrivateNearestNeighborsSearch/PnnsProtocol.swift b/Sources/PrivateNearestNeighborSearch/PnnsProtocol.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/PnnsProtocol.swift rename to Sources/PrivateNearestNeighborSearch/PnnsProtocol.swift diff --git a/Sources/PrivateNearestNeighborsSearch/PrivateNearestNeighborsSearch.docc/PrivateNearestNeighborsSearch.md b/Sources/PrivateNearestNeighborSearch/PrivateNearestNeighborSearch.docc/PrivateNearestNeighborSearch.md similarity index 79% rename from Sources/PrivateNearestNeighborsSearch/PrivateNearestNeighborsSearch.docc/PrivateNearestNeighborsSearch.md rename to Sources/PrivateNearestNeighborSearch/PrivateNearestNeighborSearch.docc/PrivateNearestNeighborSearch.md index 8ea2baad..6385e2bf 100644 --- a/Sources/PrivateNearestNeighborsSearch/PrivateNearestNeighborsSearch.docc/PrivateNearestNeighborsSearch.md +++ b/Sources/PrivateNearestNeighborSearch/PrivateNearestNeighborSearch.docc/PrivateNearestNeighborSearch.md @@ -1,10 +1,10 @@ -# ``PrivateNearestNeighborsSearch`` +# ``PrivateNearestNeighborSearch`` -Private nearest neighbors search (PNNS) enables search on vector databases. +Private nearest neighbor search (PNNS) enables search on vector databases. ## Overview -Private nearest neighbors search (PNNS) enables a client with a private vector to search for the nearest vectors in a database hosted by a server, *without the server learning the client's vector.*. +Private nearest neighbor search (PNNS) enables a client with a private vector to search for the nearest vectors in a database hosted by a server, *without the server learning the client's vector.*. Each row in the database is a *vector* with an associated *entry identifier* and *entry metadata*. During the PNNS protocol, the client issues a query using its private vector, and learns the nearest neighbors according to a ``DistanceMetric``. Specifically, the client learns the distances between the client's query vector to the nearest neighbors, as well as the entry identifier and entry metadata of the nearest neighbors. diff --git a/Sources/PrivateNearestNeighborsSearch/ProcessedDatabase.swift b/Sources/PrivateNearestNeighborSearch/ProcessedDatabase.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearch/ProcessedDatabase.swift rename to Sources/PrivateNearestNeighborSearch/ProcessedDatabase.swift index 589e51cd..af3791f4 100644 --- a/Sources/PrivateNearestNeighborsSearch/ProcessedDatabase.swift +++ b/Sources/PrivateNearestNeighborSearch/ProcessedDatabase.swift @@ -180,7 +180,7 @@ public struct ValidationResult { } extension Database { - /// Processes the database for neareset neighbors computation. + /// Processes the database for nearest neighbor search. /// - Parameters: /// - config: Configuration to process with. /// - contexts: Contexts for HE computation, one per plaintext modulus. diff --git a/Sources/PrivateNearestNeighborsSearch/SerializedCiphertextMatrix.swift b/Sources/PrivateNearestNeighborSearch/SerializedCiphertextMatrix.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/SerializedCiphertextMatrix.swift rename to Sources/PrivateNearestNeighborSearch/SerializedCiphertextMatrix.swift diff --git a/Sources/PrivateNearestNeighborsSearch/SerializedPlaintextMatrix.swift b/Sources/PrivateNearestNeighborSearch/SerializedPlaintextMatrix.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/SerializedPlaintextMatrix.swift rename to Sources/PrivateNearestNeighborSearch/SerializedPlaintextMatrix.swift diff --git a/Sources/PrivateNearestNeighborsSearch/Server.swift b/Sources/PrivateNearestNeighborSearch/Server.swift similarity index 96% rename from Sources/PrivateNearestNeighborsSearch/Server.swift rename to Sources/PrivateNearestNeighborSearch/Server.swift index d7eb0ba2..6f75071d 100644 --- a/Sources/PrivateNearestNeighborsSearch/Server.swift +++ b/Sources/PrivateNearestNeighborSearch/Server.swift @@ -14,7 +14,7 @@ import HomomorphicEncryption -/// Private nearest neighbors server. +/// Private nearest neighbor server. public struct Server: Sendable { /// The database. public let database: ProcessedDatabase @@ -29,7 +29,7 @@ public struct Server: Sendable { config.clientConfig } - /// Configuration needed for private nearest neighbors search. + /// Configuration needed for private nearest neighbor search. public var evaluationKeyConfig: EvaluationKeyConfig { config.clientConfig.evaluationKeyConfig } diff --git a/Sources/PrivateNearestNeighborsSearch/Util.swift b/Sources/PrivateNearestNeighborSearch/Util.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearch/Util.swift rename to Sources/PrivateNearestNeighborSearch/Util.swift diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/ConversionApi.swift b/Sources/PrivateNearestNeighborSearchProtobuf/ConversionApi.swift similarity index 98% rename from Sources/PrivateNearestNeighborsSearchProtobuf/ConversionApi.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/ConversionApi.swift index 10b995e9..16606325 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/ConversionApi.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/ConversionApi.swift @@ -16,7 +16,7 @@ import Foundation import HomomorphicEncryption import HomomorphicEncryptionProtobuf -import PrivateNearestNeighborsSearch +import PrivateNearestNeighborSearch extension Apple_SwiftHomomorphicEncryption_Api_Pnns_V1_PNNSShardResponse { /// Converts the protobuf object to a native type. diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/ConversionError.swift b/Sources/PrivateNearestNeighborSearchProtobuf/ConversionError.swift similarity index 100% rename from Sources/PrivateNearestNeighborsSearchProtobuf/ConversionError.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/ConversionError.swift diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/ConversionPnns.swift b/Sources/PrivateNearestNeighborSearchProtobuf/ConversionPnns.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/ConversionPnns.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/ConversionPnns.swift index 1ab31255..764e67c2 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/ConversionPnns.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/ConversionPnns.swift @@ -15,7 +15,7 @@ import Foundation import HomomorphicEncryption -import PrivateNearestNeighborsSearch +import PrivateNearestNeighborSearch extension Apple_SwiftHomomorphicEncryption_Pnns_V1_DistanceMetric { /// Converts the protobuf object to a native type. diff --git a/Sources/PrivateNearestNeighborSearchProtobuf/PrivateNearestNeighborSearchProtobuf.docc/PrivateNearestNeighborSearch.md b/Sources/PrivateNearestNeighborSearchProtobuf/PrivateNearestNeighborSearchProtobuf.docc/PrivateNearestNeighborSearch.md new file mode 100644 index 00000000..48caa42a --- /dev/null +++ b/Sources/PrivateNearestNeighborSearchProtobuf/PrivateNearestNeighborSearchProtobuf.docc/PrivateNearestNeighborSearch.md @@ -0,0 +1,11 @@ +# ``PrivateNearestNeighborSearchProtobuf`` + +Protocol buffer support for [PrivateNearestNeighborSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearch) + +## Overview +`PrivateNearestNeighborProtobuf` contains supports for using [PrivateNearestNeighborSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearch) with [protocol buffers](https://protobuf.dev/), commonly referred to as `protobuf`. +This module contains: +* the generated Swift code to use the protobuf types. +* conversion between protobuf types and [PrivateNearestNeighborSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborsearch) runtime types. + +The protobuf schemas are defined at [https://github.com/apple/swift-homomorphic-encryption-protobuf](https://github.com/apple/swift-homomorphic-encryption-protobuf). diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/README.md b/Sources/PrivateNearestNeighborSearchProtobuf/generated/README.md similarity index 100% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/README.md rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/README.md diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift index 22ea88d5..4f7dea8d 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_api.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/pnns/v1/api.proto diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift index 7e4a597c..3de47f37 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_pnns_v1_pnns.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/pnns/v1/pnns.proto diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift index a2b55397..ee9e224e 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/api/shared/v1/api_shared.proto diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift index 63a77f42..1b243120 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf import HomomorphicEncryptionProtobuf diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift index 2169c884..ab4e7ee3 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_client_config.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf import HomomorphicEncryptionProtobuf diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift index a3fe23df..2cea7596 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_database.proto diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift index cc22a4c3..b7d2637b 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_distance_metric.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift index eae9f18e..7eb7e05d 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_matrix_packing.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift index 76f72773..689321dd 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_processed_database.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_processed_database.proto diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift similarity index 99% rename from Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift rename to Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift index 2e110a52..645f8f70 100644 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift +++ b/Sources/PrivateNearestNeighborSearchProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_server_config.pb.swift @@ -1,5 +1,6 @@ // DO NOT EDIT. // swift-format-ignore-file +// swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple/swift_homomorphic_encryption/pnns/v1/pnns_server_config.proto @@ -21,7 +22,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/protobuf_module_mappings.txtpb b/Sources/PrivateNearestNeighborSearchProtobuf/protobuf_module_mappings.txtpb similarity index 100% rename from Sources/PrivateNearestNeighborsSearchProtobuf/protobuf_module_mappings.txtpb rename to Sources/PrivateNearestNeighborSearchProtobuf/protobuf_module_mappings.txtpb diff --git a/Sources/PrivateNearestNeighborsSearchProtobuf/PrivateNearestNeighborsSearchProtobuf.docc/PrivateNearestNeighborsSearch.md b/Sources/PrivateNearestNeighborsSearchProtobuf/PrivateNearestNeighborsSearchProtobuf.docc/PrivateNearestNeighborsSearch.md deleted file mode 100644 index 4e585ef5..00000000 --- a/Sources/PrivateNearestNeighborsSearchProtobuf/PrivateNearestNeighborsSearchProtobuf.docc/PrivateNearestNeighborsSearch.md +++ /dev/null @@ -1,11 +0,0 @@ -# ``PrivateNearestNeighborsSearchProtobuf`` - -Protocol buffer support for [PrivateNearestNeighborsSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearch) - -## Overview -`PrivateNearestNeighborsProtobuf` contains supports for using [PrivateNearestNeighborsSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearch) with [protocol buffers](https://protobuf.dev/), commonly referred to as `protobuf`. -This module contains: -* the generated Swift code to use the protobuf types. -* conversion between protobuf types and [PrivateNearestNeighborsSearch](https://swiftpackageindex.com/apple/swift-homomorphic-encryption/main/documentation/privatenearestneighborssearch) runtime types. - -The protobuf schemas are defined at [https://github.com/apple/swift-homomorphic-encryption-protobuf](https://github.com/apple/swift-homomorphic-encryption-protobuf). diff --git a/Tests/PrivateNearestNeighborsSearchProtobufTests/ConversionTests.swift b/Tests/PrivateNearestNeighborSearchProtobufTests/ConversionTests.swift similarity index 99% rename from Tests/PrivateNearestNeighborsSearchProtobufTests/ConversionTests.swift rename to Tests/PrivateNearestNeighborSearchProtobufTests/ConversionTests.swift index 37122f98..89e04727 100644 --- a/Tests/PrivateNearestNeighborsSearchProtobufTests/ConversionTests.swift +++ b/Tests/PrivateNearestNeighborSearchProtobufTests/ConversionTests.swift @@ -13,8 +13,8 @@ // limitations under the License. @testable import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch -import PrivateNearestNeighborsSearchProtobuf +@testable import PrivateNearestNeighborSearch +import PrivateNearestNeighborSearchProtobuf import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/CiphertextMatrixTests.swift b/Tests/PrivateNearestNeighborSearchTests/CiphertextMatrixTests.swift similarity index 99% rename from Tests/PrivateNearestNeighborsSearchTests/CiphertextMatrixTests.swift rename to Tests/PrivateNearestNeighborSearchTests/CiphertextMatrixTests.swift index 32cc3b92..c7cebd82 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/CiphertextMatrixTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/CiphertextMatrixTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/ClientTests.swift b/Tests/PrivateNearestNeighborSearchTests/ClientTests.swift similarity index 99% rename from Tests/PrivateNearestNeighborsSearchTests/ClientTests.swift rename to Tests/PrivateNearestNeighborSearchTests/ClientTests.swift index 6821417c..23cf454c 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/ClientTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/ClientTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/CosineSimilarityTests.swift b/Tests/PrivateNearestNeighborSearchTests/CosineSimilarityTests.swift similarity index 98% rename from Tests/PrivateNearestNeighborsSearchTests/CosineSimilarityTests.swift rename to Tests/PrivateNearestNeighborSearchTests/CosineSimilarityTests.swift index 4875ba5e..e3aceb99 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/CosineSimilarityTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/CosineSimilarityTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/DatabaseTests.swift b/Tests/PrivateNearestNeighborSearchTests/DatabaseTests.swift similarity index 98% rename from Tests/PrivateNearestNeighborsSearchTests/DatabaseTests.swift rename to Tests/PrivateNearestNeighborSearchTests/DatabaseTests.swift index 3a965ea8..59092aef 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/DatabaseTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/DatabaseTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/MatrixMultiplicationTests.swift b/Tests/PrivateNearestNeighborSearchTests/MatrixMultiplicationTests.swift similarity index 99% rename from Tests/PrivateNearestNeighborsSearchTests/MatrixMultiplicationTests.swift rename to Tests/PrivateNearestNeighborSearchTests/MatrixMultiplicationTests.swift index 657a7b6d..43a99a51 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/MatrixMultiplicationTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/MatrixMultiplicationTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/PlaintextMatrixTests.swift b/Tests/PrivateNearestNeighborSearchTests/PlaintextMatrixTests.swift similarity index 99% rename from Tests/PrivateNearestNeighborsSearchTests/PlaintextMatrixTests.swift rename to Tests/PrivateNearestNeighborSearchTests/PlaintextMatrixTests.swift index 81c7e88e..2e49b01e 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/PlaintextMatrixTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/PlaintextMatrixTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Tests/PrivateNearestNeighborsSearchTests/Utils.swift b/Tests/PrivateNearestNeighborSearchTests/Utils.swift similarity index 98% rename from Tests/PrivateNearestNeighborsSearchTests/Utils.swift rename to Tests/PrivateNearestNeighborSearchTests/Utils.swift index ed61ab16..8ee5c817 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/Utils.swift +++ b/Tests/PrivateNearestNeighborSearchTests/Utils.swift @@ -14,7 +14,7 @@ import Foundation import HomomorphicEncryption -import PrivateNearestNeighborsSearch +import PrivateNearestNeighborSearch struct DatabaseConfig { let rowCount: Int diff --git a/Tests/PrivateNearestNeighborsSearchTests/UtilsTests.swift b/Tests/PrivateNearestNeighborSearchTests/UtilsTests.swift similarity index 98% rename from Tests/PrivateNearestNeighborsSearchTests/UtilsTests.swift rename to Tests/PrivateNearestNeighborSearchTests/UtilsTests.swift index 4a8b7a2d..8984270c 100644 --- a/Tests/PrivateNearestNeighborsSearchTests/UtilsTests.swift +++ b/Tests/PrivateNearestNeighborSearchTests/UtilsTests.swift @@ -13,7 +13,7 @@ // limitations under the License. import HomomorphicEncryption -@testable import PrivateNearestNeighborsSearch +@testable import PrivateNearestNeighborSearch import TestUtilities import XCTest diff --git a/Utilities/generate-protobuf-files.sh b/Utilities/generate-protobuf-files.sh index 2eaaafcc..98579ad0 100755 --- a/Utilities/generate-protobuf-files.sh +++ b/Utilities/generate-protobuf-files.sh @@ -24,17 +24,17 @@ find apple/swift_homomorphic_encryption/pir/ \ --swift_opt=FileNaming=PathToUnderscores \ --swift_out ../Sources/PrivateInformationRetrievalProtobuf/generated {} \; -echo "Removing PrivateNearestNeighborsSearchProtobuf swift protobuf files" -rm ../Sources/PrivateNearestNeighborsSearchProtobuf/generated/*.pb.swift -echo "Regenerating PrivateNearestNeighborsSearchProtobuf swift protobuf files" +echo "Removing PrivateNearestNeighborSearchProtobuf swift protobuf files" +rm ../Sources/PrivateNearestNeighborSearchProtobuf/generated/*.pb.swift +echo "Regenerating PrivateNearestNeighborSearchProtobuf swift protobuf files" find apple/swift_homomorphic_encryption/pnns/ \ apple/swift_homomorphic_encryption/api/shared/v1/ \ apple/swift_homomorphic_encryption/api/pnns/v1/ \ -name "*.proto" -exec protoc \ - --swift_opt=ProtoPathModuleMappings=../Sources/PrivateNearestNeighborsSearchProtobuf/protobuf_module_mappings.txtpb \ + --swift_opt=ProtoPathModuleMappings=../Sources/PrivateNearestNeighborSearchProtobuf/protobuf_module_mappings.txtpb \ --swift_opt=Visibility=Public \ --swift_opt=FileNaming=PathToUnderscores \ - --swift_out ../Sources/PrivateNearestNeighborsSearchProtobuf/generated {} \; + --swift_out ../Sources/PrivateNearestNeighborSearchProtobuf/generated {} \; cd - echo "Done updating protobuf files" diff --git a/swift-homomorphic-encryption-protobuf b/swift-homomorphic-encryption-protobuf index 4b54a2a8..e2fcb506 160000 --- a/swift-homomorphic-encryption-protobuf +++ b/swift-homomorphic-encryption-protobuf @@ -1 +1 @@ -Subproject commit 4b54a2a848a1607b3d6cde120807e8007403242c +Subproject commit e2fcb506442719d00b11914ebe6e85779c5b5b4c