Skip to content

Commit 83a9acc

Browse files
committed
Use encodingEntrySize for IndexPir
1 parent 5d6a963 commit 83a9acc

24 files changed

+272
-86
lines changed

Sources/ApplicationProtobuf/PirConversion.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters {
175175
entrySizeInBytes: Int(entrySize),
176176
dimensions: dimensions.map(Int.init),
177177
batchSize: Int(batchSize),
178-
evaluationKeyConfig: evaluationKeyConfig.native())
178+
evaluationKeyConfig: evaluationKeyConfig.native(),
179+
encodingEntrySize: encodingEntrySize)
179180
}
180181

181182
/// Converts the protobuf object into a native type.

Sources/ApplicationProtobuf/PirConversionApi.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
1+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -50,14 +50,18 @@ extension Apple_SwiftHomomorphicEncryption_Api_Pir_V1_PIRShardConfig {
5050
/// - Parameters:
5151
/// - batchSize: Number of queries in a batch.
5252
/// - evaluationKeyConfig: Evaluation key configuration
53+
/// - encodingEntrySize: Whether to encode the size.
5354
/// - Returns: The converted native type.
54-
public func native(batchSize: Int, evaluationKeyConfig: EvaluationKeyConfig) -> IndexPirParameter {
55+
public func native(batchSize: Int, encodingEntrySize: Bool, evaluationKeyConfig: EvaluationKeyConfig)
56+
-> IndexPirParameter
57+
{
5558
IndexPirParameter(
5659
entryCount: Int(numEntries),
5760
entrySizeInBytes: Int(entrySize),
5861
dimensions: dimensions.map(Int.init),
5962
batchSize: batchSize,
60-
evaluationKeyConfig: evaluationKeyConfig)
63+
evaluationKeyConfig: evaluationKeyConfig,
64+
encodingEntrySize: encodingEntrySize)
6165
}
6266
}
6367

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_api_shared_v1_api_shared.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir.pb.swift

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.
@@ -196,6 +196,12 @@ public struct Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: @unchecked
196196
set {_uniqueStorage()._keyCompressionStrategy = newValue}
197197
}
198198

199+
/// Whether to encode the entry size as part of the Index PIR response.
200+
public var encodingEntrySize: Bool {
201+
get {return _storage._encodingEntrySize}
202+
set {_uniqueStorage()._encodingEntrySize = newValue}
203+
}
204+
199205
public var unknownFields = SwiftProtobuf.UnknownStorage()
200206

201207
public init() {}
@@ -358,7 +364,7 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_SymmetricPirConfigType: SwiftP
358364

359365
extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
360366
public static let protoMessageName: String = _protobuf_package + ".PirParameters"
361-
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}encryption_parameters\0\u{3}num_entries\0\u{3}entry_size\0\u{1}dimensions\0\u{3}keyword_pir_params\0\u{1}algorithm\0\u{3}batch_size\0\u{3}evaluation_key_config\0\u{3}key_compression_strategy\0\u{c}\u{a}\u{1}\u{c}\u{b}\u{1}\u{c}\u{c}\u{1}")
367+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}encryption_parameters\0\u{3}num_entries\0\u{3}entry_size\0\u{1}dimensions\0\u{3}keyword_pir_params\0\u{1}algorithm\0\u{3}batch_size\0\u{3}evaluation_key_config\0\u{3}key_compression_strategy\0\u{4}\u{4}encoding_entry_size\0\u{c}\u{a}\u{1}\u{c}\u{b}\u{1}\u{c}\u{c}\u{1}")
362368

363369
fileprivate class _StorageClass {
364370
var _encryptionParameters: HomomorphicEncryptionProtobuf.Apple_SwiftHomomorphicEncryption_V1_EncryptionParameters? = nil
@@ -370,6 +376,7 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.M
370376
var _batchSize: UInt64 = 0
371377
var _evaluationKeyConfig: HomomorphicEncryptionProtobuf.Apple_SwiftHomomorphicEncryption_V1_EvaluationKeyConfig? = nil
372378
var _keyCompressionStrategy: Apple_SwiftHomomorphicEncryption_Pir_V1_KeyCompressionStrategy = .unspecified
379+
var _encodingEntrySize: Bool = false
373380

374381
// This property is used as the initial default value for new instances of the type.
375382
// The type itself is protecting the reference to its storage via CoW semantics.
@@ -389,6 +396,7 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.M
389396
_batchSize = source._batchSize
390397
_evaluationKeyConfig = source._evaluationKeyConfig
391398
_keyCompressionStrategy = source._keyCompressionStrategy
399+
_encodingEntrySize = source._encodingEntrySize
392400
}
393401
}
394402

@@ -416,6 +424,7 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.M
416424
case 7: try { try decoder.decodeSingularUInt64Field(value: &_storage._batchSize) }()
417425
case 8: try { try decoder.decodeSingularMessageField(value: &_storage._evaluationKeyConfig) }()
418426
case 9: try { try decoder.decodeSingularEnumField(value: &_storage._keyCompressionStrategy) }()
427+
case 13: try { try decoder.decodeSingularBoolField(value: &_storage._encodingEntrySize) }()
419428
default: break
420429
}
421430
}
@@ -455,6 +464,9 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.M
455464
if _storage._keyCompressionStrategy != .unspecified {
456465
try visitor.visitSingularEnumField(value: _storage._keyCompressionStrategy, fieldNumber: 9)
457466
}
467+
if _storage._encodingEntrySize != false {
468+
try visitor.visitSingularBoolField(value: _storage._encodingEntrySize, fieldNumber: 13)
469+
}
458470
}
459471
try unknownFields.traverse(visitor: &visitor)
460472
}
@@ -473,6 +485,7 @@ extension Apple_SwiftHomomorphicEncryption_Pir_V1_PirParameters: SwiftProtobuf.M
473485
if _storage._batchSize != rhs_storage._batchSize {return false}
474486
if _storage._evaluationKeyConfig != rhs_storage._evaluationKeyConfig {return false}
475487
if _storage._keyCompressionStrategy != rhs_storage._keyCompressionStrategy {return false}
488+
if _storage._encodingEntrySize != rhs_storage._encodingEntrySize {return false}
476489
return true
477490
}
478491
if !storagesAreEqual {return false}

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pir_v1_pir_algorithm.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_client_config.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_database.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_distance_metric.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

Sources/ApplicationProtobuf/generated/apple_swift_homomorphic_encryption_pnns_v1_pnns_matrix_packing.pb.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// For information on using the generated types, please see the documentation:
99
// https://github.com/apple/swift-protobuf/
1010

11-
// Copyright 2024-2025 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2026 Apple Inc. and the Swift Homomorphic Encryption project authors
1212
//
1313
// Licensed under the Apache License, Version 2.0 (the "License");
1414
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)