Skip to content

Commit

Permalink
Regenerate proto files (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
fboemer authored Nov 11, 2024
1 parent 02af24d commit 3c947af
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Three arguments enable this best-effort approach towards symmetric PIR:
* `maxSerializedBucketSize`. We can set size equal to the number of bytes in a plaintexts. This roughly says that each
bucket can hold as many bytes as a single plaintext.
* `useMaxSerializedBucketSize`. When enabled, the IndexPIR layer will assume that each entry is as large as
`maxSerializedBucketSize`. This avoids packing multiple hash buckets into a single plaintexts.
`maxSerializedBucketSize`. This avoids packing multiple hash buckets into a single plaintext.

Together these options can be used to control the number of entries in a response.

Expand Down
4 changes: 1 addition & 3 deletions Sources/PrivateInformationRetrieval/KeywordPirProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ public final class KeywordPirServer<PirServer: IndexPirServer>: KeywordPirProtoc
throws -> ProcessedDatabaseWithParameters<Scheme>
{
func onCuckooEvent(event: CuckooTable.Event) throws {
try onEvent(
ProcessKeywordDatabase.ProcessShardEvent
.cuckooTableEvent(event))
try onEvent(ProcessKeywordDatabase.ProcessShardEvent.cuckooTableEvent(event))
}

let cuckooTableConfig = config.cuckooTableConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
}

/// Request for server side configurations.
public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: Sendable {
public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.
Expand All @@ -45,6 +45,9 @@ public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: Sendabl
/// When set to empty array, all configs will be returned.
public var usecases: [String] = []

/// For each usecase, the existing config id, if one exists.
public var existingConfigIds: [Data] = []

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}
Expand All @@ -71,6 +74,9 @@ public struct Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config: @unchecked Sen
/// Unique identifier for the configuration.
public var configID: Data = Data()

/// Indicator that the config is the same config as in the ConfigRequest. If set, all other fields can be unset.
public var reuseExistingConfig: Bool = false

public var unknownFields = SwiftProtobuf.UnknownStorage()

/// Configuration.
Expand Down Expand Up @@ -199,6 +205,7 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: SwiftProtob
public static let protoMessageName: String = _protobuf_package + ".ConfigRequest"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "usecases"),
2: .standard(proto: "existing_config_ids"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -208,6 +215,7 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: SwiftProtob
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeRepeatedStringField(value: &self.usecases) }()
case 2: try { try decoder.decodeRepeatedBytesField(value: &self.existingConfigIds) }()
default: break
}
}
Expand All @@ -217,11 +225,15 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest: SwiftProtob
if !self.usecases.isEmpty {
try visitor.visitRepeatedStringField(value: self.usecases, fieldNumber: 1)
}
if !self.existingConfigIds.isEmpty {
try visitor.visitRepeatedBytesField(value: self.existingConfigIds, fieldNumber: 2)
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_ConfigRequest) -> Bool {
if lhs.usecases != rhs.usecases {return false}
if lhs.existingConfigIds != rhs.existingConfigIds {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand All @@ -232,6 +244,7 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config: SwiftProtobuf.Mess
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .standard(proto: "pir_config"),
3: .standard(proto: "config_id"),
4: .standard(proto: "reuse_existing_config"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
Expand All @@ -254,6 +267,7 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config: SwiftProtobuf.Mess
}
}()
case 3: try { try decoder.decodeSingularBytesField(value: &self.configID) }()
case 4: try { try decoder.decodeSingularBoolField(value: &self.reuseExistingConfig) }()
default: break
}
}
Expand All @@ -270,12 +284,16 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config: SwiftProtobuf.Mess
if !self.configID.isEmpty {
try visitor.visitSingularBytesField(value: self.configID, fieldNumber: 3)
}
if self.reuseExistingConfig != false {
try visitor.visitSingularBoolField(value: self.reuseExistingConfig, fieldNumber: 4)
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config, rhs: Apple_SwiftHomomorphicEncryption_Api_Pir_V1_Config) -> Bool {
if lhs.config != rhs.config {return false}
if lhs.configID != rhs.configID {return false}
if lhs.reuseExistingConfig != rhs.reuseExistingConfig {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down
Loading

0 comments on commit 3c947af

Please sign in to comment.