Skip to content

Commit 2c9c50a

Browse files
authored
Update swift-homomorphic-encryption-protobuf (#203)
1 parent 2fb77d7 commit 2c9c50a

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

Sources/PrivateInformationRetrievalProtobuf/generated/apple_swift_homomorphic_encryption_api_pir_v1_pir.pb.swift

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,21 @@ public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRResponse: Sendable
285285
/// Encrypted replies, each of which is a ciphertext vector.
286286
public var replies: [HomomorphicEncryptionProtobuf.Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertextVec] = []
287287

288+
/// Stash of entries with the most recent updates that have not yet reached the processed database.
289+
public var stash: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries {
290+
get {return _stash ?? Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries()}
291+
set {_stash = newValue}
292+
}
293+
/// Returns true if `stash` has been explicitly set.
294+
public var hasStash: Bool {return self._stash != nil}
295+
/// Clears the value of `stash`. Subsequent reads from it will return its default value.
296+
public mutating func clearStash() {self._stash = nil}
297+
288298
public var unknownFields = SwiftProtobuf.UnknownStorage()
289299

290300
public init() {}
301+
302+
fileprivate var _stash: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries? = nil
291303
}
292304

293305
/// PIR OPRF Request.
@@ -324,6 +336,33 @@ public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_OPRFResponse: @uncheck
324336
public init() {}
325337
}
326338

339+
/// Stash of entries.
340+
///
341+
/// Stash is meant to be used as temporary storage until we can update the processed database.
342+
public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries: @unchecked Sendable {
343+
// SwiftProtobuf.Message conformance is added in an extension below. See the
344+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
345+
// methods supported on all messages.
346+
347+
/// Sorted list of hashed keywords.
348+
///
349+
/// hashed_keyword = Truncate(SHA256(keyword))
350+
public var hashedKeywords: [UInt64] = []
351+
352+
/// The values associated with each keyword in the `hashed_keywords` list. Must be in the same order.
353+
public var values: [Data] = []
354+
355+
/// Sorted list of hashed keywords that were removed from the dataset.
356+
///
357+
/// This list contains hashed keywords that were deleted, but may still be present in the processed database.
358+
/// hashed_keyword = Truncate(SHA256(keyword))
359+
public var removedHashedKeywords: [UInt64] = []
360+
361+
public var unknownFields = SwiftProtobuf.UnknownStorage()
362+
363+
public init() {}
364+
}
365+
327366
// MARK: - Code below here is support for the SwiftProtobuf runtime.
328367

329368
fileprivate let _protobuf_package = "apple.swift_homomorphic_encryption.api.pir.v1"
@@ -678,6 +717,7 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRResponse: SwiftProtobuf
678717
public static let protoMessageName: String = _protobuf_package + ".PIRResponse"
679718
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
680719
1: .same(proto: "replies"),
720+
2: .same(proto: "stash"),
681721
]
682722

683723
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@@ -687,20 +727,29 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRResponse: SwiftProtobuf
687727
// enabled. https://github.com/apple/swift-protobuf/issues/1034
688728
switch fieldNumber {
689729
case 1: try { try decoder.decodeRepeatedMessageField(value: &self.replies) }()
730+
case 2: try { try decoder.decodeSingularMessageField(value: &self._stash) }()
690731
default: break
691732
}
692733
}
693734
}
694735

695736
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
737+
// The use of inline closures is to circumvent an issue where the compiler
738+
// allocates stack space for every if/case branch local when no optimizations
739+
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
740+
// https://github.com/apple/swift-protobuf/issues/1182
696741
if !self.replies.isEmpty {
697742
try visitor.visitRepeatedMessageField(value: self.replies, fieldNumber: 1)
698743
}
744+
try { if let v = self._stash {
745+
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
746+
} }()
699747
try unknownFields.traverse(visitor: &visitor)
700748
}
701749

702750
public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRResponse, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRResponse) -> Bool {
703751
if lhs.replies != rhs.replies {return false}
752+
if lhs._stash != rhs._stash {return false}
704753
if lhs.unknownFields != rhs.unknownFields {return false}
705754
return true
706755
}
@@ -781,3 +830,47 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_OPRFResponse: SwiftProtobu
781830
return true
782831
}
783832
}
833+
834+
extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
835+
public static let protoMessageName: String = _protobuf_package + ".StashOfEntries"
836+
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
837+
1: .standard(proto: "hashed_keywords"),
838+
2: .same(proto: "values"),
839+
3: .standard(proto: "removed_hashed_keywords"),
840+
]
841+
842+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
843+
while let fieldNumber = try decoder.nextFieldNumber() {
844+
// The use of inline closures is to circumvent an issue where the compiler
845+
// allocates stack space for every case branch when no optimizations are
846+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
847+
switch fieldNumber {
848+
case 1: try { try decoder.decodeRepeatedUInt64Field(value: &self.hashedKeywords) }()
849+
case 2: try { try decoder.decodeRepeatedBytesField(value: &self.values) }()
850+
case 3: try { try decoder.decodeRepeatedUInt64Field(value: &self.removedHashedKeywords) }()
851+
default: break
852+
}
853+
}
854+
}
855+
856+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
857+
if !self.hashedKeywords.isEmpty {
858+
try visitor.visitPackedUInt64Field(value: self.hashedKeywords, fieldNumber: 1)
859+
}
860+
if !self.values.isEmpty {
861+
try visitor.visitRepeatedBytesField(value: self.values, fieldNumber: 2)
862+
}
863+
if !self.removedHashedKeywords.isEmpty {
864+
try visitor.visitPackedUInt64Field(value: self.removedHashedKeywords, fieldNumber: 3)
865+
}
866+
try unknownFields.traverse(visitor: &visitor)
867+
}
868+
869+
public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_StashOfEntries) -> Bool {
870+
if lhs.hashedKeywords != rhs.hashedKeywords {return false}
871+
if lhs.values != rhs.values {return false}
872+
if lhs.removedHashedKeywords != rhs.removedHashedKeywords {return false}
873+
if lhs.unknownFields != rhs.unknownFields {return false}
874+
return true
875+
}
876+
}

0 commit comments

Comments
 (0)