Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/HomomorphicEncryption/HeScheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ModularArithmetic
/// Polynomial format.
///
/// - Warning: There should be no other conformances to ``PolyFormat`` beyond ``Coeff`` and ``Eval``.
public protocol PolyFormat {
public protocol PolyFormat: Sendable {
/// A textual representation of the format.
static var description: String { get }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ extension MulPirServer {

try await responseCiphertexts
.append(.init(stride(from: 0, to: database.count, by: perChunkPlaintextCount).async
.map { startIndex in
.map { [queryCiphertexts, firstDimensionQueries] startIndex in
try await self.computeResponseForOneChunk(
expandedDim0Query: firstDimensionQueries,
expandedRemainingQuery: queryCiphertexts,
Expand Down
21 changes: 11 additions & 10 deletions Sources/PrivateInformationRetrieval/IndexPir/PirUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import HomomorphicEncryption
import ModularArithmetic

/// A protocol outlining the auxiliary functionalities used in PIR.
public protocol PirUtilProtocol {
public protocol PirUtilProtocol: Sendable {
/// The underlying HE scheme.
associatedtype Scheme: HeScheme
/// The Scalar type used by the HE scheme.
Expand Down Expand Up @@ -169,15 +169,16 @@ extension PirUtilProtocol {
remainingOutputs -= outputToGenerate
return outputToGenerate
}
let expanded: [[CanonicalCiphertext]] = try await .init((0..<ciphertexts.count).async.map { ciphertextIndex in
let outputToGenerate = lengths[ciphertextIndex]
return try await expandCiphertext(
ciphertexts[ciphertextIndex],
outputCount: outputToGenerate,
logStep: 1,
expectedHeight: outputToGenerate.ceilLog2,
using: evaluationKey)
})
let expanded: [[CanonicalCiphertext]] = try await .init((0..<ciphertexts.count).async
.map { [ciphertexts] ciphertextIndex in
let outputToGenerate = lengths[ciphertextIndex]
return try await expandCiphertext(
ciphertexts[ciphertextIndex],
outputCount: outputToGenerate,
logStep: 1,
expectedHeight: outputToGenerate.ceilLog2,
using: evaluationKey)
})
return expanded.flatMap(\.self)
}

Expand Down