mirror of
https://github.com/grishka/NearDrop.git
synced 2026-04-03 01:36:15 +02:00
An experimental share extension to send files and too much refactoring
closes #4
This commit is contained in:
540
NearbyShare/Protobuf/device_to_device_messages.pb.swift
Normal file
540
NearbyShare/Protobuf/device_to_device_messages.pb.swift
Normal file
@@ -0,0 +1,540 @@
|
||||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||
// Source: device_to_device_messages.proto
|
||||
//
|
||||
// For information on using the generated types, please see the documentation:
|
||||
// https://github.com/apple/swift-protobuf/
|
||||
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Foundation
|
||||
import SwiftProtobuf
|
||||
|
||||
// If the compiler emits an error on this type, it is because this file
|
||||
// was generated by a version of the `protoc` Swift plug-in that is
|
||||
// incompatible with the version of SwiftProtobuf to which you are linking.
|
||||
// Please ensure that you are building against the same version of the API
|
||||
// that was used to generate this file.
|
||||
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
||||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
||||
typealias Version = _2
|
||||
}
|
||||
|
||||
/// Type of curve
|
||||
enum Securegcm_Curve: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
case ed25519 // = 1
|
||||
|
||||
init() {
|
||||
self = .ed25519
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 1: self = .ed25519
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .ed25519: return 1
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securegcm_Curve: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
/// Used by protocols between devices
|
||||
struct Securegcm_DeviceToDeviceMessage {
|
||||
// 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.
|
||||
|
||||
/// the payload of the message
|
||||
var message: Data {
|
||||
get {return _message ?? Data()}
|
||||
set {_message = newValue}
|
||||
}
|
||||
/// Returns true if `message` has been explicitly set.
|
||||
var hasMessage: Bool {return self._message != nil}
|
||||
/// Clears the value of `message`. Subsequent reads from it will return its default value.
|
||||
mutating func clearMessage() {self._message = nil}
|
||||
|
||||
/// the sequence number of the message - must be increasing.
|
||||
var sequenceNumber: Int32 {
|
||||
get {return _sequenceNumber ?? 0}
|
||||
set {_sequenceNumber = newValue}
|
||||
}
|
||||
/// Returns true if `sequenceNumber` has been explicitly set.
|
||||
var hasSequenceNumber: Bool {return self._sequenceNumber != nil}
|
||||
/// Clears the value of `sequenceNumber`. Subsequent reads from it will return its default value.
|
||||
mutating func clearSequenceNumber() {self._sequenceNumber = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _message: Data? = nil
|
||||
fileprivate var _sequenceNumber: Int32? = nil
|
||||
}
|
||||
|
||||
/// sent as the first message from initiator to responder
|
||||
/// in an unauthenticated Diffie-Hellman Key Exchange
|
||||
struct Securegcm_InitiatorHello {
|
||||
// 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.
|
||||
|
||||
/// The session public key to send to the responder
|
||||
var publicDhKey: Securemessage_GenericPublicKey {
|
||||
get {return _publicDhKey ?? Securemessage_GenericPublicKey()}
|
||||
set {_publicDhKey = newValue}
|
||||
}
|
||||
/// Returns true if `publicDhKey` has been explicitly set.
|
||||
var hasPublicDhKey: Bool {return self._publicDhKey != nil}
|
||||
/// Clears the value of `publicDhKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPublicDhKey() {self._publicDhKey = nil}
|
||||
|
||||
/// The protocol version
|
||||
var protocolVersion: Int32 {
|
||||
get {return _protocolVersion ?? 0}
|
||||
set {_protocolVersion = newValue}
|
||||
}
|
||||
/// Returns true if `protocolVersion` has been explicitly set.
|
||||
var hasProtocolVersion: Bool {return self._protocolVersion != nil}
|
||||
/// Clears the value of `protocolVersion`. Subsequent reads from it will return its default value.
|
||||
mutating func clearProtocolVersion() {self._protocolVersion = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _publicDhKey: Securemessage_GenericPublicKey? = nil
|
||||
fileprivate var _protocolVersion: Int32? = nil
|
||||
}
|
||||
|
||||
/// sent inside the header of the first message from the responder to the
|
||||
/// initiator in an unauthenticated Diffie-Hellman Key Exchange
|
||||
struct Securegcm_ResponderHello {
|
||||
// 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.
|
||||
|
||||
/// The session public key to send to the initiator
|
||||
var publicDhKey: Securemessage_GenericPublicKey {
|
||||
get {return _publicDhKey ?? Securemessage_GenericPublicKey()}
|
||||
set {_publicDhKey = newValue}
|
||||
}
|
||||
/// Returns true if `publicDhKey` has been explicitly set.
|
||||
var hasPublicDhKey: Bool {return self._publicDhKey != nil}
|
||||
/// Clears the value of `publicDhKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPublicDhKey() {self._publicDhKey = nil}
|
||||
|
||||
/// The protocol version
|
||||
var protocolVersion: Int32 {
|
||||
get {return _protocolVersion ?? 0}
|
||||
set {_protocolVersion = newValue}
|
||||
}
|
||||
/// Returns true if `protocolVersion` has been explicitly set.
|
||||
var hasProtocolVersion: Bool {return self._protocolVersion != nil}
|
||||
/// Clears the value of `protocolVersion`. Subsequent reads from it will return its default value.
|
||||
mutating func clearProtocolVersion() {self._protocolVersion = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _publicDhKey: Securemessage_GenericPublicKey? = nil
|
||||
fileprivate var _protocolVersion: Int32? = nil
|
||||
}
|
||||
|
||||
/// A convenience proto for encoding curve points in affine representation
|
||||
struct Securegcm_EcPoint {
|
||||
// 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.
|
||||
|
||||
var curve: Securegcm_Curve {
|
||||
get {return _curve ?? .ed25519}
|
||||
set {_curve = newValue}
|
||||
}
|
||||
/// Returns true if `curve` has been explicitly set.
|
||||
var hasCurve: Bool {return self._curve != nil}
|
||||
/// Clears the value of `curve`. Subsequent reads from it will return its default value.
|
||||
mutating func clearCurve() {self._curve = nil}
|
||||
|
||||
/// x and y are encoded in big-endian two's complement
|
||||
/// client MUST verify (x,y) is a valid point on the specified curve
|
||||
var x: Data {
|
||||
get {return _x ?? Data()}
|
||||
set {_x = newValue}
|
||||
}
|
||||
/// Returns true if `x` has been explicitly set.
|
||||
var hasX: Bool {return self._x != nil}
|
||||
/// Clears the value of `x`. Subsequent reads from it will return its default value.
|
||||
mutating func clearX() {self._x = nil}
|
||||
|
||||
var y: Data {
|
||||
get {return _y ?? Data()}
|
||||
set {_y = newValue}
|
||||
}
|
||||
/// Returns true if `y` has been explicitly set.
|
||||
var hasY: Bool {return self._y != nil}
|
||||
/// Clears the value of `y`. Subsequent reads from it will return its default value.
|
||||
mutating func clearY() {self._y = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _curve: Securegcm_Curve? = nil
|
||||
fileprivate var _x: Data? = nil
|
||||
fileprivate var _y: Data? = nil
|
||||
}
|
||||
|
||||
struct Securegcm_SpakeHandshakeMessage {
|
||||
// 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.
|
||||
|
||||
/// Each flow in the protocol bumps this counter
|
||||
var flowNumber: Int32 {
|
||||
get {return _flowNumber ?? 0}
|
||||
set {_flowNumber = newValue}
|
||||
}
|
||||
/// Returns true if `flowNumber` has been explicitly set.
|
||||
var hasFlowNumber: Bool {return self._flowNumber != nil}
|
||||
/// Clears the value of `flowNumber`. Subsequent reads from it will return its default value.
|
||||
mutating func clearFlowNumber() {self._flowNumber = nil}
|
||||
|
||||
/// Some (but not all) SPAKE flows send a point on an elliptic curve
|
||||
var ecPoint: Securegcm_EcPoint {
|
||||
get {return _ecPoint ?? Securegcm_EcPoint()}
|
||||
set {_ecPoint = newValue}
|
||||
}
|
||||
/// Returns true if `ecPoint` has been explicitly set.
|
||||
var hasEcPoint: Bool {return self._ecPoint != nil}
|
||||
/// Clears the value of `ecPoint`. Subsequent reads from it will return its default value.
|
||||
mutating func clearEcPoint() {self._ecPoint = nil}
|
||||
|
||||
/// Some (but not all) SPAKE flows send a hash value
|
||||
var hashValue_p: Data {
|
||||
get {return _hashValue_p ?? Data()}
|
||||
set {_hashValue_p = newValue}
|
||||
}
|
||||
/// Returns true if `hashValue_p` has been explicitly set.
|
||||
var hasHashValue_p: Bool {return self._hashValue_p != nil}
|
||||
/// Clears the value of `hashValue_p`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHashValue_p() {self._hashValue_p = nil}
|
||||
|
||||
/// The last flow of a SPAKE protocol can send an optional payload,
|
||||
/// since the key exchange is already complete on the sender's side.
|
||||
var payload: Data {
|
||||
get {return _payload ?? Data()}
|
||||
set {_payload = newValue}
|
||||
}
|
||||
/// Returns true if `payload` has been explicitly set.
|
||||
var hasPayload: Bool {return self._payload != nil}
|
||||
/// Clears the value of `payload`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPayload() {self._payload = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _flowNumber: Int32? = nil
|
||||
fileprivate var _ecPoint: Securegcm_EcPoint? = nil
|
||||
fileprivate var _hashValue_p: Data? = nil
|
||||
fileprivate var _payload: Data? = nil
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension Securegcm_Curve: @unchecked Sendable {}
|
||||
extension Securegcm_DeviceToDeviceMessage: @unchecked Sendable {}
|
||||
extension Securegcm_InitiatorHello: @unchecked Sendable {}
|
||||
extension Securegcm_ResponderHello: @unchecked Sendable {}
|
||||
extension Securegcm_EcPoint: @unchecked Sendable {}
|
||||
extension Securegcm_SpakeHandshakeMessage: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
fileprivate let _protobuf_package = "securegcm"
|
||||
|
||||
extension Securegcm_Curve: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "ED_25519"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securegcm_DeviceToDeviceMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".DeviceToDeviceMessage"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "message"),
|
||||
2: .standard(proto: "sequence_number"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._message) }()
|
||||
case 2: try { try decoder.decodeSingularInt32Field(value: &self._sequenceNumber) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._message {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._sequenceNumber {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_DeviceToDeviceMessage, rhs: Securegcm_DeviceToDeviceMessage) -> Bool {
|
||||
if lhs._message != rhs._message {return false}
|
||||
if lhs._sequenceNumber != rhs._sequenceNumber {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_InitiatorHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".InitiatorHello"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "public_dh_key"),
|
||||
2: .standard(proto: "protocol_version"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if let v = self._publicDhKey, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularMessageField(value: &self._publicDhKey) }()
|
||||
case 2: try { try decoder.decodeSingularInt32Field(value: &self._protocolVersion) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._publicDhKey {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._protocolVersion {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_InitiatorHello, rhs: Securegcm_InitiatorHello) -> Bool {
|
||||
if lhs._publicDhKey != rhs._publicDhKey {return false}
|
||||
if lhs._protocolVersion != rhs._protocolVersion {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_ResponderHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".ResponderHello"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "public_dh_key"),
|
||||
2: .standard(proto: "protocol_version"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if let v = self._publicDhKey, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularMessageField(value: &self._publicDhKey) }()
|
||||
case 2: try { try decoder.decodeSingularInt32Field(value: &self._protocolVersion) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._publicDhKey {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._protocolVersion {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_ResponderHello, rhs: Securegcm_ResponderHello) -> Bool {
|
||||
if lhs._publicDhKey != rhs._publicDhKey {return false}
|
||||
if lhs._protocolVersion != rhs._protocolVersion {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_EcPoint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".EcPoint"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "curve"),
|
||||
2: .same(proto: "x"),
|
||||
3: .same(proto: "y"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._curve == nil {return false}
|
||||
if self._x == nil {return false}
|
||||
if self._y == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._curve) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._x) }()
|
||||
case 3: try { try decoder.decodeSingularBytesField(value: &self._y) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._curve {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._x {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try { if let v = self._y {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_EcPoint, rhs: Securegcm_EcPoint) -> Bool {
|
||||
if lhs._curve != rhs._curve {return false}
|
||||
if lhs._x != rhs._x {return false}
|
||||
if lhs._y != rhs._y {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_SpakeHandshakeMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".SpakeHandshakeMessage"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "flow_number"),
|
||||
2: .standard(proto: "ec_point"),
|
||||
3: .standard(proto: "hash_value"),
|
||||
4: .same(proto: "payload"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if let v = self._ecPoint, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularInt32Field(value: &self._flowNumber) }()
|
||||
case 2: try { try decoder.decodeSingularMessageField(value: &self._ecPoint) }()
|
||||
case 3: try { try decoder.decodeSingularBytesField(value: &self._hashValue_p) }()
|
||||
case 4: try { try decoder.decodeSingularBytesField(value: &self._payload) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._flowNumber {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._ecPoint {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try { if let v = self._hashValue_p {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try { if let v = self._payload {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 4)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_SpakeHandshakeMessage, rhs: Securegcm_SpakeHandshakeMessage) -> Bool {
|
||||
if lhs._flowNumber != rhs._flowNumber {return false}
|
||||
if lhs._ecPoint != rhs._ecPoint {return false}
|
||||
if lhs._hashValue_p != rhs._hashValue_p {return false}
|
||||
if lhs._payload != rhs._payload {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
3653
NearbyShare/Protobuf/offline_wire_formats.pb.swift
Normal file
3653
NearbyShare/Protobuf/offline_wire_formats.pb.swift
Normal file
File diff suppressed because it is too large
Load Diff
1522
NearbyShare/Protobuf/securegcm.pb.swift
Normal file
1522
NearbyShare/Protobuf/securegcm.pb.swift
Normal file
File diff suppressed because it is too large
Load Diff
951
NearbyShare/Protobuf/securemessage.pb.swift
Normal file
951
NearbyShare/Protobuf/securemessage.pb.swift
Normal file
@@ -0,0 +1,951 @@
|
||||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||
// Source: securemessage.proto
|
||||
//
|
||||
// For information on using the generated types, please see the documentation:
|
||||
// https://github.com/apple/swift-protobuf/
|
||||
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Proto definitions for SecureMessage format
|
||||
|
||||
import Foundation
|
||||
import SwiftProtobuf
|
||||
|
||||
// If the compiler emits an error on this type, it is because this file
|
||||
// was generated by a version of the `protoc` Swift plug-in that is
|
||||
// incompatible with the version of SwiftProtobuf to which you are linking.
|
||||
// Please ensure that you are building against the same version of the API
|
||||
// that was used to generate this file.
|
||||
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
||||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
||||
typealias Version = _2
|
||||
}
|
||||
|
||||
/// Supported "signature" schemes (both symmetric key and public key based)
|
||||
enum Securemessage_SigScheme: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
case hmacSha256 // = 1
|
||||
case ecdsaP256Sha256 // = 2
|
||||
|
||||
/// Not recommended -- use ECDSA_P256_SHA256 instead
|
||||
case rsa2048Sha256 // = 3
|
||||
|
||||
init() {
|
||||
self = .hmacSha256
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 1: self = .hmacSha256
|
||||
case 2: self = .ecdsaP256Sha256
|
||||
case 3: self = .rsa2048Sha256
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .hmacSha256: return 1
|
||||
case .ecdsaP256Sha256: return 2
|
||||
case .rsa2048Sha256: return 3
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securemessage_SigScheme: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
/// Supported encryption schemes
|
||||
enum Securemessage_EncScheme: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
|
||||
/// No encryption
|
||||
case none // = 1
|
||||
case aes256Cbc // = 2
|
||||
|
||||
init() {
|
||||
self = .none
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 1: self = .none
|
||||
case 2: self = .aes256Cbc
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .none: return 1
|
||||
case .aes256Cbc: return 2
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securemessage_EncScheme: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
/// A list of supported public key types
|
||||
enum Securemessage_PublicKeyType: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
case ecP256 // = 1
|
||||
case rsa2048 // = 2
|
||||
|
||||
/// 2048-bit MODP group 14, from RFC 3526
|
||||
case dh2048Modp // = 3
|
||||
|
||||
init() {
|
||||
self = .ecP256
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 1: self = .ecP256
|
||||
case 2: self = .rsa2048
|
||||
case 3: self = .dh2048Modp
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .ecP256: return 1
|
||||
case .rsa2048: return 2
|
||||
case .dh2048Modp: return 3
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securemessage_PublicKeyType: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
struct Securemessage_SecureMessage {
|
||||
// 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.
|
||||
|
||||
/// Must contain a HeaderAndBody message
|
||||
var headerAndBody: Data {
|
||||
get {return _headerAndBody ?? Data()}
|
||||
set {_headerAndBody = newValue}
|
||||
}
|
||||
/// Returns true if `headerAndBody` has been explicitly set.
|
||||
var hasHeaderAndBody: Bool {return self._headerAndBody != nil}
|
||||
/// Clears the value of `headerAndBody`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHeaderAndBody() {self._headerAndBody = nil}
|
||||
|
||||
/// Signature of header_and_body
|
||||
var signature: Data {
|
||||
get {return _signature ?? Data()}
|
||||
set {_signature = newValue}
|
||||
}
|
||||
/// Returns true if `signature` has been explicitly set.
|
||||
var hasSignature: Bool {return self._signature != nil}
|
||||
/// Clears the value of `signature`. Subsequent reads from it will return its default value.
|
||||
mutating func clearSignature() {self._signature = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _headerAndBody: Data? = nil
|
||||
fileprivate var _signature: Data? = nil
|
||||
}
|
||||
|
||||
struct Securemessage_Header {
|
||||
// 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.
|
||||
|
||||
var signatureScheme: Securemessage_SigScheme {
|
||||
get {return _signatureScheme ?? .hmacSha256}
|
||||
set {_signatureScheme = newValue}
|
||||
}
|
||||
/// Returns true if `signatureScheme` has been explicitly set.
|
||||
var hasSignatureScheme: Bool {return self._signatureScheme != nil}
|
||||
/// Clears the value of `signatureScheme`. Subsequent reads from it will return its default value.
|
||||
mutating func clearSignatureScheme() {self._signatureScheme = nil}
|
||||
|
||||
var encryptionScheme: Securemessage_EncScheme {
|
||||
get {return _encryptionScheme ?? .none}
|
||||
set {_encryptionScheme = newValue}
|
||||
}
|
||||
/// Returns true if `encryptionScheme` has been explicitly set.
|
||||
var hasEncryptionScheme: Bool {return self._encryptionScheme != nil}
|
||||
/// Clears the value of `encryptionScheme`. Subsequent reads from it will return its default value.
|
||||
mutating func clearEncryptionScheme() {self._encryptionScheme = nil}
|
||||
|
||||
/// Identifies the verification key
|
||||
var verificationKeyID: Data {
|
||||
get {return _verificationKeyID ?? Data()}
|
||||
set {_verificationKeyID = newValue}
|
||||
}
|
||||
/// Returns true if `verificationKeyID` has been explicitly set.
|
||||
var hasVerificationKeyID: Bool {return self._verificationKeyID != nil}
|
||||
/// Clears the value of `verificationKeyID`. Subsequent reads from it will return its default value.
|
||||
mutating func clearVerificationKeyID() {self._verificationKeyID = nil}
|
||||
|
||||
/// Identifies the decryption key
|
||||
var decryptionKeyID: Data {
|
||||
get {return _decryptionKeyID ?? Data()}
|
||||
set {_decryptionKeyID = newValue}
|
||||
}
|
||||
/// Returns true if `decryptionKeyID` has been explicitly set.
|
||||
var hasDecryptionKeyID: Bool {return self._decryptionKeyID != nil}
|
||||
/// Clears the value of `decryptionKeyID`. Subsequent reads from it will return its default value.
|
||||
mutating func clearDecryptionKeyID() {self._decryptionKeyID = nil}
|
||||
|
||||
/// Encryption may use an IV
|
||||
var iv: Data {
|
||||
get {return _iv ?? Data()}
|
||||
set {_iv = newValue}
|
||||
}
|
||||
/// Returns true if `iv` has been explicitly set.
|
||||
var hasIv: Bool {return self._iv != nil}
|
||||
/// Clears the value of `iv`. Subsequent reads from it will return its default value.
|
||||
mutating func clearIv() {self._iv = nil}
|
||||
|
||||
/// Arbitrary per-protocol public data, to be sent with the plain-text header
|
||||
var publicMetadata: Data {
|
||||
get {return _publicMetadata ?? Data()}
|
||||
set {_publicMetadata = newValue}
|
||||
}
|
||||
/// Returns true if `publicMetadata` has been explicitly set.
|
||||
var hasPublicMetadata: Bool {return self._publicMetadata != nil}
|
||||
/// Clears the value of `publicMetadata`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPublicMetadata() {self._publicMetadata = nil}
|
||||
|
||||
/// The length of some associated data this is not sent in this SecureMessage,
|
||||
/// but which will be bound to the signature.
|
||||
var associatedDataLength: UInt32 {
|
||||
get {return _associatedDataLength ?? 0}
|
||||
set {_associatedDataLength = newValue}
|
||||
}
|
||||
/// Returns true if `associatedDataLength` has been explicitly set.
|
||||
var hasAssociatedDataLength: Bool {return self._associatedDataLength != nil}
|
||||
/// Clears the value of `associatedDataLength`. Subsequent reads from it will return its default value.
|
||||
mutating func clearAssociatedDataLength() {self._associatedDataLength = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _signatureScheme: Securemessage_SigScheme? = nil
|
||||
fileprivate var _encryptionScheme: Securemessage_EncScheme? = nil
|
||||
fileprivate var _verificationKeyID: Data? = nil
|
||||
fileprivate var _decryptionKeyID: Data? = nil
|
||||
fileprivate var _iv: Data? = nil
|
||||
fileprivate var _publicMetadata: Data? = nil
|
||||
fileprivate var _associatedDataLength: UInt32? = nil
|
||||
}
|
||||
|
||||
struct Securemessage_HeaderAndBody {
|
||||
// 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.
|
||||
|
||||
/// Public data about this message (to be bound in the signature)
|
||||
var header: Securemessage_Header {
|
||||
get {return _header ?? Securemessage_Header()}
|
||||
set {_header = newValue}
|
||||
}
|
||||
/// Returns true if `header` has been explicitly set.
|
||||
var hasHeader: Bool {return self._header != nil}
|
||||
/// Clears the value of `header`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHeader() {self._header = nil}
|
||||
|
||||
/// Payload data
|
||||
var body: Data {
|
||||
get {return _body ?? Data()}
|
||||
set {_body = newValue}
|
||||
}
|
||||
/// Returns true if `body` has been explicitly set.
|
||||
var hasBody: Bool {return self._body != nil}
|
||||
/// Clears the value of `body`. Subsequent reads from it will return its default value.
|
||||
mutating func clearBody() {self._body = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _header: Securemessage_Header? = nil
|
||||
fileprivate var _body: Data? = nil
|
||||
}
|
||||
|
||||
/// Must be kept wire-format compatible with HeaderAndBody. Provides the
|
||||
/// SecureMessage code with a consistent wire-format representation that
|
||||
/// remains stable irrespective of protobuf implementation choices. This
|
||||
/// low-level representation of a HeaderAndBody should not be used by
|
||||
/// any code outside of the SecureMessage library implementation/tests.
|
||||
struct Securemessage_HeaderAndBodyInternal {
|
||||
// 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.
|
||||
|
||||
/// A raw (wire-format) byte encoding of a Header, suitable for hashing
|
||||
var header: Data {
|
||||
get {return _header ?? Data()}
|
||||
set {_header = newValue}
|
||||
}
|
||||
/// Returns true if `header` has been explicitly set.
|
||||
var hasHeader: Bool {return self._header != nil}
|
||||
/// Clears the value of `header`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHeader() {self._header = nil}
|
||||
|
||||
/// Payload data
|
||||
var body: Data {
|
||||
get {return _body ?? Data()}
|
||||
set {_body = newValue}
|
||||
}
|
||||
/// Returns true if `body` has been explicitly set.
|
||||
var hasBody: Bool {return self._body != nil}
|
||||
/// Clears the value of `body`. Subsequent reads from it will return its default value.
|
||||
mutating func clearBody() {self._body = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _header: Data? = nil
|
||||
fileprivate var _body: Data? = nil
|
||||
}
|
||||
|
||||
/// A convenience proto for encoding NIST P-256 elliptic curve public keys
|
||||
struct Securemessage_EcP256PublicKey {
|
||||
// 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.
|
||||
|
||||
/// x and y are encoded in big-endian two's complement (slightly wasteful)
|
||||
/// Client MUST verify (x,y) is a valid point on NIST P256
|
||||
var x: Data {
|
||||
get {return _x ?? Data()}
|
||||
set {_x = newValue}
|
||||
}
|
||||
/// Returns true if `x` has been explicitly set.
|
||||
var hasX: Bool {return self._x != nil}
|
||||
/// Clears the value of `x`. Subsequent reads from it will return its default value.
|
||||
mutating func clearX() {self._x = nil}
|
||||
|
||||
var y: Data {
|
||||
get {return _y ?? Data()}
|
||||
set {_y = newValue}
|
||||
}
|
||||
/// Returns true if `y` has been explicitly set.
|
||||
var hasY: Bool {return self._y != nil}
|
||||
/// Clears the value of `y`. Subsequent reads from it will return its default value.
|
||||
mutating func clearY() {self._y = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _x: Data? = nil
|
||||
fileprivate var _y: Data? = nil
|
||||
}
|
||||
|
||||
/// A convenience proto for encoding RSA public keys with small exponents
|
||||
struct Securemessage_SimpleRsaPublicKey {
|
||||
// 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.
|
||||
|
||||
/// Encoded in big-endian two's complement
|
||||
var n: Data {
|
||||
get {return _n ?? Data()}
|
||||
set {_n = newValue}
|
||||
}
|
||||
/// Returns true if `n` has been explicitly set.
|
||||
var hasN: Bool {return self._n != nil}
|
||||
/// Clears the value of `n`. Subsequent reads from it will return its default value.
|
||||
mutating func clearN() {self._n = nil}
|
||||
|
||||
var e: Int32 {
|
||||
get {return _e ?? 65537}
|
||||
set {_e = newValue}
|
||||
}
|
||||
/// Returns true if `e` has been explicitly set.
|
||||
var hasE: Bool {return self._e != nil}
|
||||
/// Clears the value of `e`. Subsequent reads from it will return its default value.
|
||||
mutating func clearE() {self._e = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _n: Data? = nil
|
||||
fileprivate var _e: Int32? = nil
|
||||
}
|
||||
|
||||
/// A convenience proto for encoding Diffie-Hellman public keys,
|
||||
/// for use only when Elliptic Curve based key exchanges are not possible.
|
||||
/// (Note that the group parameters must be specified separately)
|
||||
struct Securemessage_DhPublicKey {
|
||||
// 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.
|
||||
|
||||
/// Big-endian two's complement encoded group element
|
||||
var y: Data {
|
||||
get {return _y ?? Data()}
|
||||
set {_y = newValue}
|
||||
}
|
||||
/// Returns true if `y` has been explicitly set.
|
||||
var hasY: Bool {return self._y != nil}
|
||||
/// Clears the value of `y`. Subsequent reads from it will return its default value.
|
||||
mutating func clearY() {self._y = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _y: Data? = nil
|
||||
}
|
||||
|
||||
struct Securemessage_GenericPublicKey {
|
||||
// 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.
|
||||
|
||||
var type: Securemessage_PublicKeyType {
|
||||
get {return _type ?? .ecP256}
|
||||
set {_type = newValue}
|
||||
}
|
||||
/// Returns true if `type` has been explicitly set.
|
||||
var hasType: Bool {return self._type != nil}
|
||||
/// Clears the value of `type`. Subsequent reads from it will return its default value.
|
||||
mutating func clearType() {self._type = nil}
|
||||
|
||||
var ecP256PublicKey: Securemessage_EcP256PublicKey {
|
||||
get {return _ecP256PublicKey ?? Securemessage_EcP256PublicKey()}
|
||||
set {_ecP256PublicKey = newValue}
|
||||
}
|
||||
/// Returns true if `ecP256PublicKey` has been explicitly set.
|
||||
var hasEcP256PublicKey: Bool {return self._ecP256PublicKey != nil}
|
||||
/// Clears the value of `ecP256PublicKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearEcP256PublicKey() {self._ecP256PublicKey = nil}
|
||||
|
||||
var rsa2048PublicKey: Securemessage_SimpleRsaPublicKey {
|
||||
get {return _rsa2048PublicKey ?? Securemessage_SimpleRsaPublicKey()}
|
||||
set {_rsa2048PublicKey = newValue}
|
||||
}
|
||||
/// Returns true if `rsa2048PublicKey` has been explicitly set.
|
||||
var hasRsa2048PublicKey: Bool {return self._rsa2048PublicKey != nil}
|
||||
/// Clears the value of `rsa2048PublicKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearRsa2048PublicKey() {self._rsa2048PublicKey = nil}
|
||||
|
||||
/// Use only as a last resort
|
||||
var dh2048PublicKey: Securemessage_DhPublicKey {
|
||||
get {return _dh2048PublicKey ?? Securemessage_DhPublicKey()}
|
||||
set {_dh2048PublicKey = newValue}
|
||||
}
|
||||
/// Returns true if `dh2048PublicKey` has been explicitly set.
|
||||
var hasDh2048PublicKey: Bool {return self._dh2048PublicKey != nil}
|
||||
/// Clears the value of `dh2048PublicKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearDh2048PublicKey() {self._dh2048PublicKey = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _type: Securemessage_PublicKeyType? = nil
|
||||
fileprivate var _ecP256PublicKey: Securemessage_EcP256PublicKey? = nil
|
||||
fileprivate var _rsa2048PublicKey: Securemessage_SimpleRsaPublicKey? = nil
|
||||
fileprivate var _dh2048PublicKey: Securemessage_DhPublicKey? = nil
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension Securemessage_SigScheme: @unchecked Sendable {}
|
||||
extension Securemessage_EncScheme: @unchecked Sendable {}
|
||||
extension Securemessage_PublicKeyType: @unchecked Sendable {}
|
||||
extension Securemessage_SecureMessage: @unchecked Sendable {}
|
||||
extension Securemessage_Header: @unchecked Sendable {}
|
||||
extension Securemessage_HeaderAndBody: @unchecked Sendable {}
|
||||
extension Securemessage_HeaderAndBodyInternal: @unchecked Sendable {}
|
||||
extension Securemessage_EcP256PublicKey: @unchecked Sendable {}
|
||||
extension Securemessage_SimpleRsaPublicKey: @unchecked Sendable {}
|
||||
extension Securemessage_DhPublicKey: @unchecked Sendable {}
|
||||
extension Securemessage_GenericPublicKey: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
fileprivate let _protobuf_package = "securemessage"
|
||||
|
||||
extension Securemessage_SigScheme: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "HMAC_SHA256"),
|
||||
2: .same(proto: "ECDSA_P256_SHA256"),
|
||||
3: .same(proto: "RSA2048_SHA256"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securemessage_EncScheme: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "NONE"),
|
||||
2: .same(proto: "AES_256_CBC"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securemessage_PublicKeyType: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "EC_P256"),
|
||||
2: .same(proto: "RSA2048"),
|
||||
3: .same(proto: "DH2048_MODP"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securemessage_SecureMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".SecureMessage"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "header_and_body"),
|
||||
2: .same(proto: "signature"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._headerAndBody == nil {return false}
|
||||
if self._signature == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._headerAndBody) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._signature) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._headerAndBody {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._signature {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_SecureMessage, rhs: Securemessage_SecureMessage) -> Bool {
|
||||
if lhs._headerAndBody != rhs._headerAndBody {return false}
|
||||
if lhs._signature != rhs._signature {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_Header: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Header"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "signature_scheme"),
|
||||
2: .standard(proto: "encryption_scheme"),
|
||||
3: .standard(proto: "verification_key_id"),
|
||||
4: .standard(proto: "decryption_key_id"),
|
||||
5: .same(proto: "iv"),
|
||||
6: .standard(proto: "public_metadata"),
|
||||
7: .standard(proto: "associated_data_length"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._signatureScheme == nil {return false}
|
||||
if self._encryptionScheme == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._signatureScheme) }()
|
||||
case 2: try { try decoder.decodeSingularEnumField(value: &self._encryptionScheme) }()
|
||||
case 3: try { try decoder.decodeSingularBytesField(value: &self._verificationKeyID) }()
|
||||
case 4: try { try decoder.decodeSingularBytesField(value: &self._decryptionKeyID) }()
|
||||
case 5: try { try decoder.decodeSingularBytesField(value: &self._iv) }()
|
||||
case 6: try { try decoder.decodeSingularBytesField(value: &self._publicMetadata) }()
|
||||
case 7: try { try decoder.decodeSingularUInt32Field(value: &self._associatedDataLength) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._signatureScheme {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._encryptionScheme {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try { if let v = self._verificationKeyID {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try { if let v = self._decryptionKeyID {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 4)
|
||||
} }()
|
||||
try { if let v = self._iv {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 5)
|
||||
} }()
|
||||
try { if let v = self._publicMetadata {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 6)
|
||||
} }()
|
||||
try { if let v = self._associatedDataLength {
|
||||
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 7)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_Header, rhs: Securemessage_Header) -> Bool {
|
||||
if lhs._signatureScheme != rhs._signatureScheme {return false}
|
||||
if lhs._encryptionScheme != rhs._encryptionScheme {return false}
|
||||
if lhs._verificationKeyID != rhs._verificationKeyID {return false}
|
||||
if lhs._decryptionKeyID != rhs._decryptionKeyID {return false}
|
||||
if lhs._iv != rhs._iv {return false}
|
||||
if lhs._publicMetadata != rhs._publicMetadata {return false}
|
||||
if lhs._associatedDataLength != rhs._associatedDataLength {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_HeaderAndBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".HeaderAndBody"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "header"),
|
||||
2: .same(proto: "body"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._header == nil {return false}
|
||||
if self._body == nil {return false}
|
||||
if let v = self._header, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularMessageField(value: &self._header) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._body) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._header {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._body {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_HeaderAndBody, rhs: Securemessage_HeaderAndBody) -> Bool {
|
||||
if lhs._header != rhs._header {return false}
|
||||
if lhs._body != rhs._body {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_HeaderAndBodyInternal: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".HeaderAndBodyInternal"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "header"),
|
||||
2: .same(proto: "body"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._header == nil {return false}
|
||||
if self._body == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._header) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._body) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._header {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._body {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_HeaderAndBodyInternal, rhs: Securemessage_HeaderAndBodyInternal) -> Bool {
|
||||
if lhs._header != rhs._header {return false}
|
||||
if lhs._body != rhs._body {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_EcP256PublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".EcP256PublicKey"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "x"),
|
||||
2: .same(proto: "y"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._x == nil {return false}
|
||||
if self._y == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._x) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._y) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._x {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._y {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_EcP256PublicKey, rhs: Securemessage_EcP256PublicKey) -> Bool {
|
||||
if lhs._x != rhs._x {return false}
|
||||
if lhs._y != rhs._y {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_SimpleRsaPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".SimpleRsaPublicKey"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "n"),
|
||||
2: .same(proto: "e"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._n == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._n) }()
|
||||
case 2: try { try decoder.decodeSingularInt32Field(value: &self._e) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._n {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._e {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_SimpleRsaPublicKey, rhs: Securemessage_SimpleRsaPublicKey) -> Bool {
|
||||
if lhs._n != rhs._n {return false}
|
||||
if lhs._e != rhs._e {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_DhPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".DhPublicKey"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "y"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._y == nil {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._y) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._y {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_DhPublicKey, rhs: Securemessage_DhPublicKey) -> Bool {
|
||||
if lhs._y != rhs._y {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securemessage_GenericPublicKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".GenericPublicKey"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "type"),
|
||||
2: .standard(proto: "ec_p256_public_key"),
|
||||
3: .standard(proto: "rsa2048_public_key"),
|
||||
4: .standard(proto: "dh2048_public_key"),
|
||||
]
|
||||
|
||||
public var isInitialized: Bool {
|
||||
if self._type == nil {return false}
|
||||
if let v = self._ecP256PublicKey, !v.isInitialized {return false}
|
||||
if let v = self._rsa2048PublicKey, !v.isInitialized {return false}
|
||||
if let v = self._dh2048PublicKey, !v.isInitialized {return false}
|
||||
return true
|
||||
}
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._type) }()
|
||||
case 2: try { try decoder.decodeSingularMessageField(value: &self._ecP256PublicKey) }()
|
||||
case 3: try { try decoder.decodeSingularMessageField(value: &self._rsa2048PublicKey) }()
|
||||
case 4: try { try decoder.decodeSingularMessageField(value: &self._dh2048PublicKey) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._type {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._ecP256PublicKey {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try { if let v = self._rsa2048PublicKey {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try { if let v = self._dh2048PublicKey {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securemessage_GenericPublicKey, rhs: Securemessage_GenericPublicKey) -> Bool {
|
||||
if lhs._type != rhs._type {return false}
|
||||
if lhs._ecP256PublicKey != rhs._ecP256PublicKey {return false}
|
||||
if lhs._rsa2048PublicKey != rhs._rsa2048PublicKey {return false}
|
||||
if lhs._dh2048PublicKey != rhs._dh2048PublicKey {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
735
NearbyShare/Protobuf/ukey.pb.swift
Normal file
735
NearbyShare/Protobuf/ukey.pb.swift
Normal file
@@ -0,0 +1,735 @@
|
||||
// DO NOT EDIT.
|
||||
// swift-format-ignore-file
|
||||
//
|
||||
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
||||
// Source: ukey.proto
|
||||
//
|
||||
// For information on using the generated types, please see the documentation:
|
||||
// https://github.com/apple/swift-protobuf/
|
||||
|
||||
// Copyright 2020 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import Foundation
|
||||
import SwiftProtobuf
|
||||
|
||||
// If the compiler emits an error on this type, it is because this file
|
||||
// was generated by a version of the `protoc` Swift plug-in that is
|
||||
// incompatible with the version of SwiftProtobuf to which you are linking.
|
||||
// Please ensure that you are building against the same version of the API
|
||||
// that was used to generate this file.
|
||||
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
||||
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
||||
typealias Version = _2
|
||||
}
|
||||
|
||||
enum Securegcm_Ukey2HandshakeCipher: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
case reserved // = 0
|
||||
|
||||
/// NIST P-256 used for ECDH, SHA512 used for
|
||||
case p256Sha512 // = 100
|
||||
|
||||
/// commitment
|
||||
case curve25519Sha512 // = 200
|
||||
|
||||
init() {
|
||||
self = .reserved
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 0: self = .reserved
|
||||
case 100: self = .p256Sha512
|
||||
case 200: self = .curve25519Sha512
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .reserved: return 0
|
||||
case .p256Sha512: return 100
|
||||
case .curve25519Sha512: return 200
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securegcm_Ukey2HandshakeCipher: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
struct Securegcm_Ukey2Message {
|
||||
// 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.
|
||||
|
||||
/// Identifies message type
|
||||
var messageType: Securegcm_Ukey2Message.TypeEnum {
|
||||
get {return _messageType ?? .unknownDoNotUse}
|
||||
set {_messageType = newValue}
|
||||
}
|
||||
/// Returns true if `messageType` has been explicitly set.
|
||||
var hasMessageType: Bool {return self._messageType != nil}
|
||||
/// Clears the value of `messageType`. Subsequent reads from it will return its default value.
|
||||
mutating func clearMessageType() {self._messageType = nil}
|
||||
|
||||
/// Actual message, to be parsed according to
|
||||
var messageData: Data {
|
||||
get {return _messageData ?? Data()}
|
||||
set {_messageData = newValue}
|
||||
}
|
||||
/// Returns true if `messageData` has been explicitly set.
|
||||
var hasMessageData: Bool {return self._messageData != nil}
|
||||
/// Clears the value of `messageData`. Subsequent reads from it will return its default value.
|
||||
mutating func clearMessageData() {self._messageData = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
enum TypeEnum: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
case unknownDoNotUse // = 0
|
||||
case alert // = 1
|
||||
case clientInit // = 2
|
||||
case serverInit // = 3
|
||||
case clientFinish // = 4
|
||||
|
||||
init() {
|
||||
self = .unknownDoNotUse
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 0: self = .unknownDoNotUse
|
||||
case 1: self = .alert
|
||||
case 2: self = .clientInit
|
||||
case 3: self = .serverInit
|
||||
case 4: self = .clientFinish
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .unknownDoNotUse: return 0
|
||||
case .alert: return 1
|
||||
case .clientInit: return 2
|
||||
case .serverInit: return 3
|
||||
case .clientFinish: return 4
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _messageType: Securegcm_Ukey2Message.TypeEnum? = nil
|
||||
fileprivate var _messageData: Data? = nil
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securegcm_Ukey2Message.TypeEnum: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
struct Securegcm_Ukey2Alert {
|
||||
// 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.
|
||||
|
||||
var type: Securegcm_Ukey2Alert.AlertType {
|
||||
get {return _type ?? .badMessage}
|
||||
set {_type = newValue}
|
||||
}
|
||||
/// Returns true if `type` has been explicitly set.
|
||||
var hasType: Bool {return self._type != nil}
|
||||
/// Clears the value of `type`. Subsequent reads from it will return its default value.
|
||||
mutating func clearType() {self._type = nil}
|
||||
|
||||
var errorMessage: String {
|
||||
get {return _errorMessage ?? String()}
|
||||
set {_errorMessage = newValue}
|
||||
}
|
||||
/// Returns true if `errorMessage` has been explicitly set.
|
||||
var hasErrorMessage: Bool {return self._errorMessage != nil}
|
||||
/// Clears the value of `errorMessage`. Subsequent reads from it will return its default value.
|
||||
mutating func clearErrorMessage() {self._errorMessage = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
enum AlertType: SwiftProtobuf.Enum {
|
||||
typealias RawValue = Int
|
||||
|
||||
/// Framing errors
|
||||
case badMessage // = 1
|
||||
|
||||
/// message_type has an undefined value
|
||||
case badMessageType // = 2
|
||||
|
||||
/// message_type received does not correspond to
|
||||
case incorrectMessage // = 3
|
||||
|
||||
/// expected type at this stage of the protocol
|
||||
case badMessageData // = 4
|
||||
|
||||
/// ClientInit and ServerInit errors
|
||||
case badVersion // = 100
|
||||
|
||||
/// suitable version to speak with client.
|
||||
case badRandom // = 101
|
||||
|
||||
/// length
|
||||
case badHandshakeCipher // = 102
|
||||
|
||||
/// The next protocol is missing, unknown, or
|
||||
case badNextProtocol // = 103
|
||||
|
||||
/// unsupported
|
||||
case badPublicKey // = 104
|
||||
|
||||
/// Other errors
|
||||
case internalError // = 200
|
||||
|
||||
init() {
|
||||
self = .badMessage
|
||||
}
|
||||
|
||||
init?(rawValue: Int) {
|
||||
switch rawValue {
|
||||
case 1: self = .badMessage
|
||||
case 2: self = .badMessageType
|
||||
case 3: self = .incorrectMessage
|
||||
case 4: self = .badMessageData
|
||||
case 100: self = .badVersion
|
||||
case 101: self = .badRandom
|
||||
case 102: self = .badHandshakeCipher
|
||||
case 103: self = .badNextProtocol
|
||||
case 104: self = .badPublicKey
|
||||
case 200: self = .internalError
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var rawValue: Int {
|
||||
switch self {
|
||||
case .badMessage: return 1
|
||||
case .badMessageType: return 2
|
||||
case .incorrectMessage: return 3
|
||||
case .badMessageData: return 4
|
||||
case .badVersion: return 100
|
||||
case .badRandom: return 101
|
||||
case .badHandshakeCipher: return 102
|
||||
case .badNextProtocol: return 103
|
||||
case .badPublicKey: return 104
|
||||
case .internalError: return 200
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _type: Securegcm_Ukey2Alert.AlertType? = nil
|
||||
fileprivate var _errorMessage: String? = nil
|
||||
}
|
||||
|
||||
#if swift(>=4.2)
|
||||
|
||||
extension Securegcm_Ukey2Alert.AlertType: CaseIterable {
|
||||
// Support synthesized by the compiler.
|
||||
}
|
||||
|
||||
#endif // swift(>=4.2)
|
||||
|
||||
struct Securegcm_Ukey2ClientInit {
|
||||
// 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.
|
||||
|
||||
/// highest supported version for rollback
|
||||
var version: Int32 {
|
||||
get {return _version ?? 0}
|
||||
set {_version = newValue}
|
||||
}
|
||||
/// Returns true if `version` has been explicitly set.
|
||||
var hasVersion: Bool {return self._version != nil}
|
||||
/// Clears the value of `version`. Subsequent reads from it will return its default value.
|
||||
mutating func clearVersion() {self._version = nil}
|
||||
|
||||
/// protection
|
||||
var random: Data {
|
||||
get {return _random ?? Data()}
|
||||
set {_random = newValue}
|
||||
}
|
||||
/// Returns true if `random` has been explicitly set.
|
||||
var hasRandom: Bool {return self._random != nil}
|
||||
/// Clears the value of `random`. Subsequent reads from it will return its default value.
|
||||
mutating func clearRandom() {self._random = nil}
|
||||
|
||||
var cipherCommitments: [Securegcm_Ukey2ClientInit.CipherCommitment] = []
|
||||
|
||||
/// Next protocol that the client wants to speak.
|
||||
var nextProtocol: String {
|
||||
get {return _nextProtocol ?? String()}
|
||||
set {_nextProtocol = newValue}
|
||||
}
|
||||
/// Returns true if `nextProtocol` has been explicitly set.
|
||||
var hasNextProtocol: Bool {return self._nextProtocol != nil}
|
||||
/// Clears the value of `nextProtocol`. Subsequent reads from it will return its default value.
|
||||
mutating func clearNextProtocol() {self._nextProtocol = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
/// One commitment (hash of ClientFinished containing public key) per supported
|
||||
/// cipher
|
||||
struct CipherCommitment {
|
||||
// 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.
|
||||
|
||||
var handshakeCipher: Securegcm_Ukey2HandshakeCipher {
|
||||
get {return _handshakeCipher ?? .reserved}
|
||||
set {_handshakeCipher = newValue}
|
||||
}
|
||||
/// Returns true if `handshakeCipher` has been explicitly set.
|
||||
var hasHandshakeCipher: Bool {return self._handshakeCipher != nil}
|
||||
/// Clears the value of `handshakeCipher`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHandshakeCipher() {self._handshakeCipher = nil}
|
||||
|
||||
var commitment: Data {
|
||||
get {return _commitment ?? Data()}
|
||||
set {_commitment = newValue}
|
||||
}
|
||||
/// Returns true if `commitment` has been explicitly set.
|
||||
var hasCommitment: Bool {return self._commitment != nil}
|
||||
/// Clears the value of `commitment`. Subsequent reads from it will return its default value.
|
||||
mutating func clearCommitment() {self._commitment = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _handshakeCipher: Securegcm_Ukey2HandshakeCipher? = nil
|
||||
fileprivate var _commitment: Data? = nil
|
||||
}
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _version: Int32? = nil
|
||||
fileprivate var _random: Data? = nil
|
||||
fileprivate var _nextProtocol: String? = nil
|
||||
}
|
||||
|
||||
struct Securegcm_Ukey2ServerInit {
|
||||
// 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.
|
||||
|
||||
/// highest supported version for rollback
|
||||
var version: Int32 {
|
||||
get {return _version ?? 0}
|
||||
set {_version = newValue}
|
||||
}
|
||||
/// Returns true if `version` has been explicitly set.
|
||||
var hasVersion: Bool {return self._version != nil}
|
||||
/// Clears the value of `version`. Subsequent reads from it will return its default value.
|
||||
mutating func clearVersion() {self._version = nil}
|
||||
|
||||
/// protection
|
||||
var random: Data {
|
||||
get {return _random ?? Data()}
|
||||
set {_random = newValue}
|
||||
}
|
||||
/// Returns true if `random` has been explicitly set.
|
||||
var hasRandom: Bool {return self._random != nil}
|
||||
/// Clears the value of `random`. Subsequent reads from it will return its default value.
|
||||
mutating func clearRandom() {self._random = nil}
|
||||
|
||||
/// Selected Cipher and corresponding public key
|
||||
var handshakeCipher: Securegcm_Ukey2HandshakeCipher {
|
||||
get {return _handshakeCipher ?? .reserved}
|
||||
set {_handshakeCipher = newValue}
|
||||
}
|
||||
/// Returns true if `handshakeCipher` has been explicitly set.
|
||||
var hasHandshakeCipher: Bool {return self._handshakeCipher != nil}
|
||||
/// Clears the value of `handshakeCipher`. Subsequent reads from it will return its default value.
|
||||
mutating func clearHandshakeCipher() {self._handshakeCipher = nil}
|
||||
|
||||
var publicKey: Data {
|
||||
get {return _publicKey ?? Data()}
|
||||
set {_publicKey = newValue}
|
||||
}
|
||||
/// Returns true if `publicKey` has been explicitly set.
|
||||
var hasPublicKey: Bool {return self._publicKey != nil}
|
||||
/// Clears the value of `publicKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPublicKey() {self._publicKey = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _version: Int32? = nil
|
||||
fileprivate var _random: Data? = nil
|
||||
fileprivate var _handshakeCipher: Securegcm_Ukey2HandshakeCipher? = nil
|
||||
fileprivate var _publicKey: Data? = nil
|
||||
}
|
||||
|
||||
struct Securegcm_Ukey2ClientFinished {
|
||||
// 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.
|
||||
|
||||
/// public key matching selected handshake
|
||||
var publicKey: Data {
|
||||
get {return _publicKey ?? Data()}
|
||||
set {_publicKey = newValue}
|
||||
}
|
||||
/// Returns true if `publicKey` has been explicitly set.
|
||||
var hasPublicKey: Bool {return self._publicKey != nil}
|
||||
/// Clears the value of `publicKey`. Subsequent reads from it will return its default value.
|
||||
mutating func clearPublicKey() {self._publicKey = nil}
|
||||
|
||||
var unknownFields = SwiftProtobuf.UnknownStorage()
|
||||
|
||||
init() {}
|
||||
|
||||
fileprivate var _publicKey: Data? = nil
|
||||
}
|
||||
|
||||
#if swift(>=5.5) && canImport(_Concurrency)
|
||||
extension Securegcm_Ukey2HandshakeCipher: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2Message: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2Message.TypeEnum: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2Alert: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2Alert.AlertType: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2ClientInit: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2ClientInit.CipherCommitment: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2ServerInit: @unchecked Sendable {}
|
||||
extension Securegcm_Ukey2ClientFinished: @unchecked Sendable {}
|
||||
#endif // swift(>=5.5) && canImport(_Concurrency)
|
||||
|
||||
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
||||
|
||||
fileprivate let _protobuf_package = "securegcm"
|
||||
|
||||
extension Securegcm_Ukey2HandshakeCipher: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
0: .same(proto: "RESERVED"),
|
||||
100: .same(proto: "P256_SHA512"),
|
||||
200: .same(proto: "CURVE25519_SHA512"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Ukey2Message"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "message_type"),
|
||||
2: .standard(proto: "message_data"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._messageType) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._messageData) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._messageType {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._messageData {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2Message, rhs: Securegcm_Ukey2Message) -> Bool {
|
||||
if lhs._messageType != rhs._messageType {return false}
|
||||
if lhs._messageData != rhs._messageData {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2Message.TypeEnum: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
0: .same(proto: "UNKNOWN_DO_NOT_USE"),
|
||||
1: .same(proto: "ALERT"),
|
||||
2: .same(proto: "CLIENT_INIT"),
|
||||
3: .same(proto: "SERVER_INIT"),
|
||||
4: .same(proto: "CLIENT_FINISH"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2Alert: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Ukey2Alert"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "type"),
|
||||
2: .standard(proto: "error_message"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._type) }()
|
||||
case 2: try { try decoder.decodeSingularStringField(value: &self._errorMessage) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._type {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._errorMessage {
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2Alert, rhs: Securegcm_Ukey2Alert) -> Bool {
|
||||
if lhs._type != rhs._type {return false}
|
||||
if lhs._errorMessage != rhs._errorMessage {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2Alert.AlertType: SwiftProtobuf._ProtoNameProviding {
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "BAD_MESSAGE"),
|
||||
2: .same(proto: "BAD_MESSAGE_TYPE"),
|
||||
3: .same(proto: "INCORRECT_MESSAGE"),
|
||||
4: .same(proto: "BAD_MESSAGE_DATA"),
|
||||
100: .same(proto: "BAD_VERSION"),
|
||||
101: .same(proto: "BAD_RANDOM"),
|
||||
102: .same(proto: "BAD_HANDSHAKE_CIPHER"),
|
||||
103: .same(proto: "BAD_NEXT_PROTOCOL"),
|
||||
104: .same(proto: "BAD_PUBLIC_KEY"),
|
||||
200: .same(proto: "INTERNAL_ERROR"),
|
||||
]
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2ClientInit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Ukey2ClientInit"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "version"),
|
||||
2: .same(proto: "random"),
|
||||
3: .standard(proto: "cipher_commitments"),
|
||||
4: .standard(proto: "next_protocol"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularInt32Field(value: &self._version) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._random) }()
|
||||
case 3: try { try decoder.decodeRepeatedMessageField(value: &self.cipherCommitments) }()
|
||||
case 4: try { try decoder.decodeSingularStringField(value: &self._nextProtocol) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._version {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._random {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
if !self.cipherCommitments.isEmpty {
|
||||
try visitor.visitRepeatedMessageField(value: self.cipherCommitments, fieldNumber: 3)
|
||||
}
|
||||
try { if let v = self._nextProtocol {
|
||||
try visitor.visitSingularStringField(value: v, fieldNumber: 4)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2ClientInit, rhs: Securegcm_Ukey2ClientInit) -> Bool {
|
||||
if lhs._version != rhs._version {return false}
|
||||
if lhs._random != rhs._random {return false}
|
||||
if lhs.cipherCommitments != rhs.cipherCommitments {return false}
|
||||
if lhs._nextProtocol != rhs._nextProtocol {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2ClientInit.CipherCommitment: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = Securegcm_Ukey2ClientInit.protoMessageName + ".CipherCommitment"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "handshake_cipher"),
|
||||
2: .same(proto: "commitment"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularEnumField(value: &self._handshakeCipher) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._commitment) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._handshakeCipher {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._commitment {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2ClientInit.CipherCommitment, rhs: Securegcm_Ukey2ClientInit.CipherCommitment) -> Bool {
|
||||
if lhs._handshakeCipher != rhs._handshakeCipher {return false}
|
||||
if lhs._commitment != rhs._commitment {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2ServerInit: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Ukey2ServerInit"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .same(proto: "version"),
|
||||
2: .same(proto: "random"),
|
||||
3: .standard(proto: "handshake_cipher"),
|
||||
4: .standard(proto: "public_key"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularInt32Field(value: &self._version) }()
|
||||
case 2: try { try decoder.decodeSingularBytesField(value: &self._random) }()
|
||||
case 3: try { try decoder.decodeSingularEnumField(value: &self._handshakeCipher) }()
|
||||
case 4: try { try decoder.decodeSingularBytesField(value: &self._publicKey) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._version {
|
||||
try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try { if let v = self._random {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 2)
|
||||
} }()
|
||||
try { if let v = self._handshakeCipher {
|
||||
try visitor.visitSingularEnumField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try { if let v = self._publicKey {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 4)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2ServerInit, rhs: Securegcm_Ukey2ServerInit) -> Bool {
|
||||
if lhs._version != rhs._version {return false}
|
||||
if lhs._random != rhs._random {return false}
|
||||
if lhs._handshakeCipher != rhs._handshakeCipher {return false}
|
||||
if lhs._publicKey != rhs._publicKey {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension Securegcm_Ukey2ClientFinished: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
||||
static let protoMessageName: String = _protobuf_package + ".Ukey2ClientFinished"
|
||||
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
||||
1: .standard(proto: "public_key"),
|
||||
]
|
||||
|
||||
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
||||
while let fieldNumber = try decoder.nextFieldNumber() {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every case branch when no optimizations are
|
||||
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
||||
switch fieldNumber {
|
||||
case 1: try { try decoder.decodeSingularBytesField(value: &self._publicKey) }()
|
||||
default: break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
||||
// The use of inline closures is to circumvent an issue where the compiler
|
||||
// allocates stack space for every if/case branch local when no optimizations
|
||||
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
||||
// https://github.com/apple/swift-protobuf/issues/1182
|
||||
try { if let v = self._publicKey {
|
||||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1)
|
||||
} }()
|
||||
try unknownFields.traverse(visitor: &visitor)
|
||||
}
|
||||
|
||||
static func ==(lhs: Securegcm_Ukey2ClientFinished, rhs: Securegcm_Ukey2ClientFinished) -> Bool {
|
||||
if lhs._publicKey != rhs._publicKey {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
return true
|
||||
}
|
||||
}
|
||||
1617
NearbyShare/Protobuf/wire_format.pb.swift
Normal file
1617
NearbyShare/Protobuf/wire_format.pb.swift
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user