Skip to content

Commit b9698b0

Browse files
authored
Fix warnings (#247)
1 parent 542ea76 commit b9698b0

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

Sources/HomomorphicEncryption/HeScheme.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import ModularArithmetic
1717
/// Polynomial format.
1818
///
1919
/// - Warning: There should be no other conformances to ``PolyFormat`` beyond ``Coeff`` and ``Eval``.
20-
public protocol PolyFormat {
20+
public protocol PolyFormat: Sendable {
2121
/// A textual representation of the format.
2222
static var description: String { get }
2323
}

Sources/PrivateInformationRetrieval/IndexPir/MulPir.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ extension MulPirServer {
416416

417417
try await responseCiphertexts
418418
.append(.init(stride(from: 0, to: database.count, by: perChunkPlaintextCount).async
419-
.map { startIndex in
419+
.map { [queryCiphertexts, firstDimensionQueries] startIndex in
420420
try await self.computeResponseForOneChunk(
421421
expandedDim0Query: firstDimensionQueries,
422422
expandedRemainingQuery: queryCiphertexts,

Sources/PrivateInformationRetrieval/IndexPir/PirUtil.swift

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import HomomorphicEncryption
1717
import ModularArithmetic
1818

1919
/// A protocol outlining the auxiliary functionalities used in PIR.
20-
public protocol PirUtilProtocol {
20+
public protocol PirUtilProtocol: Sendable {
2121
/// The underlying HE scheme.
2222
associatedtype Scheme: HeScheme
2323
/// The Scalar type used by the HE scheme.
@@ -169,15 +169,16 @@ extension PirUtilProtocol {
169169
remainingOutputs -= outputToGenerate
170170
return outputToGenerate
171171
}
172-
let expanded: [[CanonicalCiphertext]] = try await .init((0..<ciphertexts.count).async.map { ciphertextIndex in
173-
let outputToGenerate = lengths[ciphertextIndex]
174-
return try await expandCiphertext(
175-
ciphertexts[ciphertextIndex],
176-
outputCount: outputToGenerate,
177-
logStep: 1,
178-
expectedHeight: outputToGenerate.ceilLog2,
179-
using: evaluationKey)
180-
})
172+
let expanded: [[CanonicalCiphertext]] = try await .init((0..<ciphertexts.count).async
173+
.map { [ciphertexts] ciphertextIndex in
174+
let outputToGenerate = lengths[ciphertextIndex]
175+
return try await expandCiphertext(
176+
ciphertexts[ciphertextIndex],
177+
outputCount: outputToGenerate,
178+
logStep: 1,
179+
expectedHeight: outputToGenerate.ceilLog2,
180+
using: evaluationKey)
181+
})
181182
return expanded.flatMap(\.self)
182183
}
183184

0 commit comments

Comments
 (0)