diff --git a/Sources/PrivateInformationRetrieval/IndexPirProtocol.swift b/Sources/PrivateInformationRetrieval/IndexPirProtocol.swift index 8364acf5..6153c3e3 100644 --- a/Sources/PrivateInformationRetrieval/IndexPirProtocol.swift +++ b/Sources/PrivateInformationRetrieval/IndexPirProtocol.swift @@ -277,12 +277,12 @@ public struct Query: Sendable { /// An index PIR response. public struct Response: Sendable { /// Ciphertexts in the response. - public let ciphertexts: [[Scheme.CanonicalCiphertext]] + public let ciphertexts: [[Scheme.CoeffCiphertext]] /// Initializes an index PIR ``Response``. /// - Parameter ciphertexts: Ciphertexts in the response. @inlinable - public init(ciphertexts: [[Scheme.CanonicalCiphertext]]) { + public init(ciphertexts: [[Scheme.CoeffCiphertext]]) { self.ciphertexts = ciphertexts } } diff --git a/Sources/PrivateInformationRetrieval/MulPir.swift b/Sources/PrivateInformationRetrieval/MulPir.swift index f293055a..4a9e6d25 100644 --- a/Sources/PrivateInformationRetrieval/MulPir.swift +++ b/Sources/PrivateInformationRetrieval/MulPir.swift @@ -311,7 +311,7 @@ extension MulPirServer { expandedRemainingQuery: ExpandedQueries, dataChunk: DataChunk, using evaluationKey: EvaluationKey) throws - -> CanonicalCiphertext + -> Ciphertext where ExpandedQueries: Collection, DataChunk: Collection?>, ExpandedQueries.Index == Int, DataChunk.Index == Int { @@ -341,7 +341,7 @@ extension MulPirServer { intermediateResults.count == 1, "There should be only 1 ciphertext in the final result for each chunk") try intermediateResults[0].modSwitchDownToSingle() - return intermediateResults[0] + return try intermediateResults[0].convertToCoeffFormat() } @inlinable diff --git a/Sources/PrivateInformationRetrievalProtobuf/ConversionApi.swift b/Sources/PrivateInformationRetrievalProtobuf/ConversionApi.swift index 31015a79..e3ae9315 100644 --- a/Sources/PrivateInformationRetrievalProtobuf/ConversionApi.swift +++ b/Sources/PrivateInformationRetrievalProtobuf/ConversionApi.swift @@ -22,10 +22,10 @@ extension Apple_SwiftHomomorphicEncryption_Api_V1_PIRResponse { /// - Returns: The converted native type. /// - Throws: Error upon invalid protobuf object. public func native(context: Context) throws -> Response { - let ciphertexts: [[Scheme.CanonicalCiphertext]] = try replies.map { reply in + let ciphertexts: [[Scheme.CoeffCiphertext]] = try replies.map { reply in let serializedCiphertexts: [SerializedCiphertext] = try reply.native() return try serializedCiphertexts.map { serialized in - try Scheme.CanonicalCiphertext(deserialize: serialized, context: context, moduliCount: 1) + try Scheme.CoeffCiphertext(deserialize: serialized, context: context, moduliCount: 1) } } return Response(ciphertexts: ciphertexts)