Skip to content

Commit 9280def

Browse files
authored
Update to latest swift-homomoprhic-encryption-protobuf (#231)
1 parent ab452d2 commit 9280def

22 files changed

+149
-417
lines changed

Package.resolved

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ let package = Package(
6868
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.10.0"),
6969
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
7070
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.0"),
71-
.package(url: "https://github.com/apple/swift-protobuf", from: "1.29.0"), // Keep version in sync with README
71+
.package(url: "https://github.com/apple/swift-protobuf", from: "1.31.1"), // Keep version in sync with README
7272
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.1.0"),
7373
],
7474
targets: [

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Developing Swift Homomorphic Encryption requires:
157157
* [Nick Lockwood SwiftFormat](https://github.com/nicklockwood/SwiftFormat), 0.56.4
158158
* [pre-commit](https://pre-commit.com)
159159
* [swift-format](https://github.com/swiftlang/swift-format), 600.0.0
160-
* [swift-protobuf](https://github.com/apple/swift-protobuf), 1.29.0
160+
* [swift-protobuf](https://github.com/apple/swift-protobuf), 1.31.1
161161
* [SwiftLint](https://github.com/realm/SwiftLint), 0.59.1
162162

163163
### Building

Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_error_stddev.pb.swift

Lines changed: 2 additions & 4 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 Apple Inc. and the Swift Homomorphic Encryption project authors
11+
// Copyright 2024-2025 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.
@@ -73,7 +73,5 @@ public enum Apple_SwiftHomomorphicEncryption_V1_ErrorStdDev: SwiftProtobuf.Enum,
7373
// MARK: - Code below here is support for the SwiftProtobuf runtime.
7474

7575
extension Apple_SwiftHomomorphicEncryption_V1_ErrorStdDev: SwiftProtobuf._ProtoNameProviding {
76-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
77-
0: .same(proto: "ERROR_STD_DEV_STDDEV32"),
78-
]
76+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0ERROR_STD_DEV_STDDEV32\0")
7977
}

Sources/HomomorphicEncryptionProtobuf/generated/apple_swift_homomorphic_encryption_v1_he.pb.swift

Lines changed: 18 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public enum Apple_SwiftHomomorphicEncryption_V1_HeScheme: SwiftProtobuf.Enum, Sw
120120
}
121121

122122
/// A serialized `Plaintext`.
123-
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedPlaintext: @unchecked Sendable {
123+
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedPlaintext: Sendable {
124124
// SwiftProtobuf.Message conformance is added in an extension below. See the
125125
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
126126
// methods supported on all messages.
@@ -189,7 +189,7 @@ public struct Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertext: Sendable
189189
}
190190

191191
/// A serialized `Ciphertext` using a seed in place of the second polynomial.
192-
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedSeededCiphertext: @unchecked Sendable {
192+
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedSeededCiphertext: Sendable {
193193
// SwiftProtobuf.Message conformance is added in an extension below. See the
194194
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
195195
// methods supported on all messages.
@@ -206,7 +206,7 @@ public struct Apple_SwiftHomomorphicEncryption_V1_SerializedSeededCiphertext: @u
206206
}
207207

208208
/// A serialized `Ciphertext` with all polynomials expanded.
209-
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedFullCiphertext: @unchecked Sendable {
209+
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedFullCiphertext: Sendable {
210210
// SwiftProtobuf.Message conformance is added in an extension below. See the
211211
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
212212
// methods supported on all messages.
@@ -292,7 +292,7 @@ public struct Apple_SwiftHomomorphicEncryption_V1_SerializedRelinKey: Sendable {
292292
}
293293

294294
/// A serialized `SecretKey`.
295-
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedSecretKey: @unchecked Sendable {
295+
public struct Apple_SwiftHomomorphicEncryption_V1_SerializedSecretKey: Sendable {
296296
// SwiftProtobuf.Message conformance is added in an extension below. See the
297297
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
298298
// methods supported on all messages.
@@ -405,25 +405,16 @@ public struct Apple_SwiftHomomorphicEncryption_V1_EncryptionParameters: Sendable
405405
fileprivate let _protobuf_package = "apple.swift_homomorphic_encryption.v1"
406406

407407
extension Apple_SwiftHomomorphicEncryption_V1_SecurityLevel: SwiftProtobuf._ProtoNameProviding {
408-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
409-
0: .same(proto: "SECURITY_LEVEL_UNSPECIFIED"),
410-
1: .same(proto: "SECURITY_LEVEL_QUANTUM128"),
411-
]
408+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0SECURITY_LEVEL_UNSPECIFIED\0\u{1}SECURITY_LEVEL_QUANTUM128\0")
412409
}
413410

414411
extension Apple_SwiftHomomorphicEncryption_V1_HeScheme: SwiftProtobuf._ProtoNameProviding {
415-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
416-
0: .same(proto: "HE_SCHEME_UNSPECIFIED"),
417-
1: .same(proto: "HE_SCHEME_BFV"),
418-
2: .same(proto: "HE_SCHEME_BGV"),
419-
]
412+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0HE_SCHEME_UNSPECIFIED\0\u{1}HE_SCHEME_BFV\0\u{1}HE_SCHEME_BGV\0")
420413
}
421414

422415
extension Apple_SwiftHomomorphicEncryption_V1_SerializedPlaintext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
423416
public static let protoMessageName: String = _protobuf_package + ".SerializedPlaintext"
424-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
425-
1: .same(proto: "poly"),
426-
]
417+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}poly\0")
427418

428419
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
429420
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -453,9 +444,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedPlaintext: SwiftProtobuf
453444

454445
extension Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertextVec: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
455446
public static let protoMessageName: String = _protobuf_package + ".SerializedCiphertextVec"
456-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
457-
1: .same(proto: "ciphertexts"),
458-
]
447+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}ciphertexts\0")
459448

460449
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
461450
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -485,10 +474,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertextVec: SwiftProt
485474

486475
extension Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
487476
public static let protoMessageName: String = _protobuf_package + ".SerializedCiphertext"
488-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
489-
1: .same(proto: "seeded"),
490-
2: .same(proto: "full"),
491-
]
477+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}seeded\0\u{1}full\0")
492478

493479
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
494480
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -555,10 +541,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedCiphertext: SwiftProtobu
555541

556542
extension Apple_SwiftHomomorphicEncryption_V1_SerializedSeededCiphertext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
557543
public static let protoMessageName: String = _protobuf_package + ".SerializedSeededCiphertext"
558-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
559-
1: .same(proto: "poly0"),
560-
2: .same(proto: "seed"),
561-
]
544+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}poly0\0\u{1}seed\0")
562545

563546
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
564547
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -593,11 +576,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedSeededCiphertext: SwiftP
593576

594577
extension Apple_SwiftHomomorphicEncryption_V1_SerializedFullCiphertext: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
595578
public static let protoMessageName: String = _protobuf_package + ".SerializedFullCiphertext"
596-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
597-
1: .same(proto: "polys"),
598-
2: .standard(proto: "skip_lsbs"),
599-
3: .standard(proto: "correction_factor"),
600-
]
579+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}polys\0\u{3}skip_lsbs\0\u{3}correction_factor\0")
601580

602581
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
603582
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -637,9 +616,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedFullCiphertext: SwiftPro
637616

638617
extension Apple_SwiftHomomorphicEncryption_V1_SerializedKeySwitchKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
639618
public static let protoMessageName: String = _protobuf_package + ".SerializedKeySwitchKey"
640-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
641-
1: .standard(proto: "key_switch_key"),
642-
]
619+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}key_switch_key\0")
643620

644621
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
645622
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -673,9 +650,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedKeySwitchKey: SwiftProto
673650

674651
extension Apple_SwiftHomomorphicEncryption_V1_SerializedGaloisKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
675652
public static let protoMessageName: String = _protobuf_package + ".SerializedGaloisKey"
676-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
677-
1: .standard(proto: "key_switch_keys"),
678-
]
653+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}key_switch_keys\0")
679654

680655
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
681656
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -705,9 +680,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedGaloisKey: SwiftProtobuf
705680

706681
extension Apple_SwiftHomomorphicEncryption_V1_SerializedRelinKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
707682
public static let protoMessageName: String = _protobuf_package + ".SerializedRelinKey"
708-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
709-
1: .standard(proto: "relin_key"),
710-
]
683+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}relin_key\0")
711684

712685
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
713686
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -741,9 +714,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedRelinKey: SwiftProtobuf.
741714

742715
extension Apple_SwiftHomomorphicEncryption_V1_SerializedSecretKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
743716
public static let protoMessageName: String = _protobuf_package + ".SerializedSecretKey"
744-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
745-
1: .same(proto: "polys"),
746-
]
717+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}polys\0")
747718

748719
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
749720
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -773,10 +744,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedSecretKey: SwiftProtobuf
773744

774745
extension Apple_SwiftHomomorphicEncryption_V1_SerializedEvaluationKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
775746
public static let protoMessageName: String = _protobuf_package + ".SerializedEvaluationKey"
776-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
777-
1: .standard(proto: "galois_key"),
778-
2: .standard(proto: "relin_key"),
779-
]
747+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}galois_key\0\u{3}relin_key\0")
780748

781749
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
782750
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -815,11 +783,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_SerializedEvaluationKey: SwiftProt
815783

816784
extension Apple_SwiftHomomorphicEncryption_V1_EvaluationKeyConfig: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
817785
public static let protoMessageName: String = _protobuf_package + ".EvaluationKeyConfig"
818-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
819-
1: .standard(proto: "encryption_parameters"),
820-
2: .standard(proto: "galois_elements"),
821-
3: .standard(proto: "has_relin_key"),
822-
]
786+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}encryption_parameters\0\u{3}galois_elements\0\u{3}has_relin_key\0")
823787

824788
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
825789
while let fieldNumber = try decoder.nextFieldNumber() {
@@ -863,14 +827,7 @@ extension Apple_SwiftHomomorphicEncryption_V1_EvaluationKeyConfig: SwiftProtobuf
863827

864828
extension Apple_SwiftHomomorphicEncryption_V1_EncryptionParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
865829
public static let protoMessageName: String = _protobuf_package + ".EncryptionParameters"
866-
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
867-
1: .standard(proto: "polynomial_degree"),
868-
2: .standard(proto: "plaintext_modulus"),
869-
3: .standard(proto: "coefficient_moduli"),
870-
4: .standard(proto: "error_std_dev"),
871-
5: .standard(proto: "security_level"),
872-
6: .standard(proto: "he_scheme"),
873-
]
830+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}polynomial_degree\0\u{3}plaintext_modulus\0\u{3}coefficient_moduli\0\u{3}error_std_dev\0\u{3}security_level\0\u{3}he_scheme\0")
874831

875832
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
876833
while let fieldNumber = try decoder.nextFieldNumber() {

0 commit comments

Comments
 (0)