aboutsummaryrefslogtreecommitdiff
path: root/nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs
diff options
context:
space:
mode:
Diffstat (limited to 'nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs')
-rw-r--r--nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs1140
1 files changed, 1140 insertions, 0 deletions
diff --git a/nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs b/nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs
new file mode 100644
index 0000000..e4d2a99
--- /dev/null
+++ b/nearby/connections/ukey2/ukey2_proto/src/ukey2_all_proto/device_to_device_messages.rs
@@ -0,0 +1,1140 @@
+// Copyright 2023 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
+//
+// http://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.
+
+// This file is generated by rust-protobuf 2.28.0. Do not edit
+// @generated
+
+// https://github.com/rust-lang/rust-clippy/issues/702
+#![allow(unknown_lints)]
+#![allow(clippy::all)]
+
+#![allow(unused_attributes)]
+#![cfg_attr(rustfmt, rustfmt::skip)]
+
+#![allow(box_pointers)]
+#![allow(dead_code)]
+#![allow(missing_docs)]
+#![allow(non_camel_case_types)]
+#![allow(non_snake_case)]
+#![allow(non_upper_case_globals)]
+#![allow(trivial_casts)]
+#![allow(unused_imports)]
+#![allow(unused_results)]
+//! Generated file from `device_to_device_messages.proto`
+
+/// Generated files are compatible only with the same version
+/// of protobuf runtime.
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0;
+
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct DeviceToDeviceMessage {
+ // message fields
+ message: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ sequence_number: ::std::option::Option<i32>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a DeviceToDeviceMessage {
+ fn default() -> &'a DeviceToDeviceMessage {
+ <DeviceToDeviceMessage as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl DeviceToDeviceMessage {
+ pub fn new() -> DeviceToDeviceMessage {
+ ::std::default::Default::default()
+ }
+
+ // optional bytes message = 1;
+
+
+ pub fn get_message(&self) -> &[u8] {
+ match self.message.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+ pub fn clear_message(&mut self) {
+ self.message.clear();
+ }
+
+ pub fn has_message(&self) -> bool {
+ self.message.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_message(&mut self, v: ::std::vec::Vec<u8>) {
+ self.message = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_message(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.message.is_none() {
+ self.message.set_default();
+ }
+ self.message.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_message(&mut self) -> ::std::vec::Vec<u8> {
+ self.message.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // optional int32 sequence_number = 2;
+
+
+ pub fn get_sequence_number(&self) -> i32 {
+ self.sequence_number.unwrap_or(0)
+ }
+ pub fn clear_sequence_number(&mut self) {
+ self.sequence_number = ::std::option::Option::None;
+ }
+
+ pub fn has_sequence_number(&self) -> bool {
+ self.sequence_number.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_sequence_number(&mut self, v: i32) {
+ self.sequence_number = ::std::option::Option::Some(v);
+ }
+}
+
+impl ::protobuf::Message for DeviceToDeviceMessage {
+ fn is_initialized(&self) -> bool {
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.message)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.sequence_number = ::std::option::Option::Some(tmp);
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.message.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(1, &v);
+ }
+ if let Some(v) = self.sequence_number {
+ my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.message.as_ref() {
+ os.write_bytes(1, &v)?;
+ }
+ if let Some(v) = self.sequence_number {
+ os.write_int32(2, v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> DeviceToDeviceMessage {
+ DeviceToDeviceMessage::new()
+ }
+
+ fn default_instance() -> &'static DeviceToDeviceMessage {
+ static instance: ::protobuf::rt::LazyV2<DeviceToDeviceMessage> = ::protobuf::rt::LazyV2::INIT;
+ instance.get(DeviceToDeviceMessage::new)
+ }
+}
+
+impl ::protobuf::Clear for DeviceToDeviceMessage {
+ fn clear(&mut self) {
+ self.message.clear();
+ self.sequence_number = ::std::option::Option::None;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for DeviceToDeviceMessage {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct InitiatorHello {
+ // message fields
+ pub public_dh_key: ::protobuf::SingularPtrField<super::securemessage::GenericPublicKey>,
+ protocol_version: ::std::option::Option<i32>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a InitiatorHello {
+ fn default() -> &'a InitiatorHello {
+ <InitiatorHello as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl InitiatorHello {
+ pub fn new() -> InitiatorHello {
+ ::std::default::Default::default()
+ }
+
+ // optional .securemessage.GenericPublicKey public_dh_key = 1;
+
+
+ pub fn get_public_dh_key(&self) -> &super::securemessage::GenericPublicKey {
+ self.public_dh_key.as_ref().unwrap_or_else(|| <super::securemessage::GenericPublicKey as ::protobuf::Message>::default_instance())
+ }
+ pub fn clear_public_dh_key(&mut self) {
+ self.public_dh_key.clear();
+ }
+
+ pub fn has_public_dh_key(&self) -> bool {
+ self.public_dh_key.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_public_dh_key(&mut self, v: super::securemessage::GenericPublicKey) {
+ self.public_dh_key = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_public_dh_key(&mut self) -> &mut super::securemessage::GenericPublicKey {
+ if self.public_dh_key.is_none() {
+ self.public_dh_key.set_default();
+ }
+ self.public_dh_key.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_public_dh_key(&mut self) -> super::securemessage::GenericPublicKey {
+ self.public_dh_key.take().unwrap_or_else(|| super::securemessage::GenericPublicKey::new())
+ }
+
+ // optional int32 protocol_version = 2;
+
+
+ pub fn get_protocol_version(&self) -> i32 {
+ self.protocol_version.unwrap_or(0i32)
+ }
+ pub fn clear_protocol_version(&mut self) {
+ self.protocol_version = ::std::option::Option::None;
+ }
+
+ pub fn has_protocol_version(&self) -> bool {
+ self.protocol_version.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_protocol_version(&mut self, v: i32) {
+ self.protocol_version = ::std::option::Option::Some(v);
+ }
+}
+
+impl ::protobuf::Message for InitiatorHello {
+ fn is_initialized(&self) -> bool {
+ for v in &self.public_dh_key {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_dh_key)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.protocol_version = ::std::option::Option::Some(tmp);
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.public_dh_key.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ if let Some(v) = self.protocol_version {
+ my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.public_dh_key.as_ref() {
+ os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ if let Some(v) = self.protocol_version {
+ os.write_int32(2, v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> InitiatorHello {
+ InitiatorHello::new()
+ }
+
+ fn default_instance() -> &'static InitiatorHello {
+ static instance: ::protobuf::rt::LazyV2<InitiatorHello> = ::protobuf::rt::LazyV2::INIT;
+ instance.get(InitiatorHello::new)
+ }
+}
+
+impl ::protobuf::Clear for InitiatorHello {
+ fn clear(&mut self) {
+ self.public_dh_key.clear();
+ self.protocol_version = ::std::option::Option::None;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for InitiatorHello {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct ResponderHello {
+ // message fields
+ pub public_dh_key: ::protobuf::SingularPtrField<super::securemessage::GenericPublicKey>,
+ protocol_version: ::std::option::Option<i32>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a ResponderHello {
+ fn default() -> &'a ResponderHello {
+ <ResponderHello as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl ResponderHello {
+ pub fn new() -> ResponderHello {
+ ::std::default::Default::default()
+ }
+
+ // optional .securemessage.GenericPublicKey public_dh_key = 1;
+
+
+ pub fn get_public_dh_key(&self) -> &super::securemessage::GenericPublicKey {
+ self.public_dh_key.as_ref().unwrap_or_else(|| <super::securemessage::GenericPublicKey as ::protobuf::Message>::default_instance())
+ }
+ pub fn clear_public_dh_key(&mut self) {
+ self.public_dh_key.clear();
+ }
+
+ pub fn has_public_dh_key(&self) -> bool {
+ self.public_dh_key.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_public_dh_key(&mut self, v: super::securemessage::GenericPublicKey) {
+ self.public_dh_key = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_public_dh_key(&mut self) -> &mut super::securemessage::GenericPublicKey {
+ if self.public_dh_key.is_none() {
+ self.public_dh_key.set_default();
+ }
+ self.public_dh_key.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_public_dh_key(&mut self) -> super::securemessage::GenericPublicKey {
+ self.public_dh_key.take().unwrap_or_else(|| super::securemessage::GenericPublicKey::new())
+ }
+
+ // optional int32 protocol_version = 2;
+
+
+ pub fn get_protocol_version(&self) -> i32 {
+ self.protocol_version.unwrap_or(0i32)
+ }
+ pub fn clear_protocol_version(&mut self) {
+ self.protocol_version = ::std::option::Option::None;
+ }
+
+ pub fn has_protocol_version(&self) -> bool {
+ self.protocol_version.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_protocol_version(&mut self, v: i32) {
+ self.protocol_version = ::std::option::Option::Some(v);
+ }
+}
+
+impl ::protobuf::Message for ResponderHello {
+ fn is_initialized(&self) -> bool {
+ for v in &self.public_dh_key {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_dh_key)?;
+ },
+ 2 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.protocol_version = ::std::option::Option::Some(tmp);
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(ref v) = self.public_dh_key.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ if let Some(v) = self.protocol_version {
+ my_size += ::protobuf::rt::value_size(2, v, ::protobuf::wire_format::WireTypeVarint);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(ref v) = self.public_dh_key.as_ref() {
+ os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ if let Some(v) = self.protocol_version {
+ os.write_int32(2, v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> ResponderHello {
+ ResponderHello::new()
+ }
+
+ fn default_instance() -> &'static ResponderHello {
+ static instance: ::protobuf::rt::LazyV2<ResponderHello> = ::protobuf::rt::LazyV2::INIT;
+ instance.get(ResponderHello::new)
+ }
+}
+
+impl ::protobuf::Clear for ResponderHello {
+ fn clear(&mut self) {
+ self.public_dh_key.clear();
+ self.protocol_version = ::std::option::Option::None;
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for ResponderHello {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct EcPoint {
+ // message fields
+ curve: ::std::option::Option<Curve>,
+ x: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ y: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a EcPoint {
+ fn default() -> &'a EcPoint {
+ <EcPoint as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl EcPoint {
+ pub fn new() -> EcPoint {
+ ::std::default::Default::default()
+ }
+
+ // required .securegcm.Curve curve = 1;
+
+
+ pub fn get_curve(&self) -> Curve {
+ self.curve.unwrap_or(Curve::ED_25519)
+ }
+ pub fn clear_curve(&mut self) {
+ self.curve = ::std::option::Option::None;
+ }
+
+ pub fn has_curve(&self) -> bool {
+ self.curve.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_curve(&mut self, v: Curve) {
+ self.curve = ::std::option::Option::Some(v);
+ }
+
+ // required bytes x = 2;
+
+
+ pub fn get_x(&self) -> &[u8] {
+ match self.x.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+ pub fn clear_x(&mut self) {
+ self.x.clear();
+ }
+
+ pub fn has_x(&self) -> bool {
+ self.x.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_x(&mut self, v: ::std::vec::Vec<u8>) {
+ self.x = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_x(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.x.is_none() {
+ self.x.set_default();
+ }
+ self.x.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_x(&mut self) -> ::std::vec::Vec<u8> {
+ self.x.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // required bytes y = 3;
+
+
+ pub fn get_y(&self) -> &[u8] {
+ match self.y.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+ pub fn clear_y(&mut self) {
+ self.y.clear();
+ }
+
+ pub fn has_y(&self) -> bool {
+ self.y.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_y(&mut self, v: ::std::vec::Vec<u8>) {
+ self.y = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_y(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.y.is_none() {
+ self.y.set_default();
+ }
+ self.y.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_y(&mut self) -> ::std::vec::Vec<u8> {
+ self.y.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+}
+
+impl ::protobuf::Message for EcPoint {
+ fn is_initialized(&self) -> bool {
+ if self.curve.is_none() {
+ return false;
+ }
+ if self.x.is_none() {
+ return false;
+ }
+ if self.y.is_none() {
+ return false;
+ }
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.curve, 1, &mut self.unknown_fields)?
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.x)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.y)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(v) = self.curve {
+ my_size += ::protobuf::rt::enum_size(1, v);
+ }
+ if let Some(ref v) = self.x.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(2, &v);
+ }
+ if let Some(ref v) = self.y.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(v) = self.curve {
+ os.write_enum(1, ::protobuf::ProtobufEnum::value(&v))?;
+ }
+ if let Some(ref v) = self.x.as_ref() {
+ os.write_bytes(2, &v)?;
+ }
+ if let Some(ref v) = self.y.as_ref() {
+ os.write_bytes(3, &v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> EcPoint {
+ EcPoint::new()
+ }
+
+ fn default_instance() -> &'static EcPoint {
+ static instance: ::protobuf::rt::LazyV2<EcPoint> = ::protobuf::rt::LazyV2::INIT;
+ instance.get(EcPoint::new)
+ }
+}
+
+impl ::protobuf::Clear for EcPoint {
+ fn clear(&mut self) {
+ self.curve = ::std::option::Option::None;
+ self.x.clear();
+ self.y.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for EcPoint {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Message(self)
+ }
+}
+
+#[derive(PartialEq,Clone,Default,Debug)]
+pub struct SpakeHandshakeMessage {
+ // message fields
+ flow_number: ::std::option::Option<i32>,
+ pub ec_point: ::protobuf::SingularPtrField<EcPoint>,
+ hash_value: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ payload: ::protobuf::SingularField<::std::vec::Vec<u8>>,
+ // special fields
+ pub unknown_fields: ::protobuf::UnknownFields,
+ pub cached_size: ::protobuf::CachedSize,
+}
+
+impl<'a> ::std::default::Default for &'a SpakeHandshakeMessage {
+ fn default() -> &'a SpakeHandshakeMessage {
+ <SpakeHandshakeMessage as ::protobuf::Message>::default_instance()
+ }
+}
+
+impl SpakeHandshakeMessage {
+ pub fn new() -> SpakeHandshakeMessage {
+ ::std::default::Default::default()
+ }
+
+ // optional int32 flow_number = 1;
+
+
+ pub fn get_flow_number(&self) -> i32 {
+ self.flow_number.unwrap_or(0)
+ }
+ pub fn clear_flow_number(&mut self) {
+ self.flow_number = ::std::option::Option::None;
+ }
+
+ pub fn has_flow_number(&self) -> bool {
+ self.flow_number.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_flow_number(&mut self, v: i32) {
+ self.flow_number = ::std::option::Option::Some(v);
+ }
+
+ // optional .securegcm.EcPoint ec_point = 2;
+
+
+ pub fn get_ec_point(&self) -> &EcPoint {
+ self.ec_point.as_ref().unwrap_or_else(|| <EcPoint as ::protobuf::Message>::default_instance())
+ }
+ pub fn clear_ec_point(&mut self) {
+ self.ec_point.clear();
+ }
+
+ pub fn has_ec_point(&self) -> bool {
+ self.ec_point.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_ec_point(&mut self, v: EcPoint) {
+ self.ec_point = ::protobuf::SingularPtrField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_ec_point(&mut self) -> &mut EcPoint {
+ if self.ec_point.is_none() {
+ self.ec_point.set_default();
+ }
+ self.ec_point.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_ec_point(&mut self) -> EcPoint {
+ self.ec_point.take().unwrap_or_else(|| EcPoint::new())
+ }
+
+ // optional bytes hash_value = 3;
+
+
+ pub fn get_hash_value(&self) -> &[u8] {
+ match self.hash_value.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+ pub fn clear_hash_value(&mut self) {
+ self.hash_value.clear();
+ }
+
+ pub fn has_hash_value(&self) -> bool {
+ self.hash_value.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_hash_value(&mut self, v: ::std::vec::Vec<u8>) {
+ self.hash_value = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_hash_value(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.hash_value.is_none() {
+ self.hash_value.set_default();
+ }
+ self.hash_value.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_hash_value(&mut self) -> ::std::vec::Vec<u8> {
+ self.hash_value.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+
+ // optional bytes payload = 4;
+
+
+ pub fn get_payload(&self) -> &[u8] {
+ match self.payload.as_ref() {
+ Some(v) => &v,
+ None => &[],
+ }
+ }
+ pub fn clear_payload(&mut self) {
+ self.payload.clear();
+ }
+
+ pub fn has_payload(&self) -> bool {
+ self.payload.is_some()
+ }
+
+ // Param is passed by value, moved
+ pub fn set_payload(&mut self, v: ::std::vec::Vec<u8>) {
+ self.payload = ::protobuf::SingularField::some(v);
+ }
+
+ // Mutable pointer to the field.
+ // If field is not initialized, it is initialized with default value first.
+ pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec<u8> {
+ if self.payload.is_none() {
+ self.payload.set_default();
+ }
+ self.payload.as_mut().unwrap()
+ }
+
+ // Take field
+ pub fn take_payload(&mut self) -> ::std::vec::Vec<u8> {
+ self.payload.take().unwrap_or_else(|| ::std::vec::Vec::new())
+ }
+}
+
+impl ::protobuf::Message for SpakeHandshakeMessage {
+ fn is_initialized(&self) -> bool {
+ for v in &self.ec_point {
+ if !v.is_initialized() {
+ return false;
+ }
+ };
+ true
+ }
+
+ fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ while !is.eof()? {
+ let (field_number, wire_type) = is.read_tag_unpack()?;
+ match field_number {
+ 1 => {
+ if wire_type != ::protobuf::wire_format::WireTypeVarint {
+ return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
+ }
+ let tmp = is.read_int32()?;
+ self.flow_number = ::std::option::Option::Some(tmp);
+ },
+ 2 => {
+ ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.ec_point)?;
+ },
+ 3 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.hash_value)?;
+ },
+ 4 => {
+ ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.payload)?;
+ },
+ _ => {
+ ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
+ },
+ };
+ }
+ ::std::result::Result::Ok(())
+ }
+
+ // Compute sizes of nested messages
+ #[allow(unused_variables)]
+ fn compute_size(&self) -> u32 {
+ let mut my_size = 0;
+ if let Some(v) = self.flow_number {
+ my_size += ::protobuf::rt::value_size(1, v, ::protobuf::wire_format::WireTypeVarint);
+ }
+ if let Some(ref v) = self.ec_point.as_ref() {
+ let len = v.compute_size();
+ my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
+ }
+ if let Some(ref v) = self.hash_value.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(3, &v);
+ }
+ if let Some(ref v) = self.payload.as_ref() {
+ my_size += ::protobuf::rt::bytes_size(4, &v);
+ }
+ my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
+ self.cached_size.set(my_size);
+ my_size
+ }
+
+ fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
+ if let Some(v) = self.flow_number {
+ os.write_int32(1, v)?;
+ }
+ if let Some(ref v) = self.ec_point.as_ref() {
+ os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
+ os.write_raw_varint32(v.get_cached_size())?;
+ v.write_to_with_cached_sizes(os)?;
+ }
+ if let Some(ref v) = self.hash_value.as_ref() {
+ os.write_bytes(3, &v)?;
+ }
+ if let Some(ref v) = self.payload.as_ref() {
+ os.write_bytes(4, &v)?;
+ }
+ os.write_unknown_fields(self.get_unknown_fields())?;
+ ::std::result::Result::Ok(())
+ }
+
+ fn get_cached_size(&self) -> u32 {
+ self.cached_size.get()
+ }
+
+ fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
+ &self.unknown_fields
+ }
+
+ fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
+ &mut self.unknown_fields
+ }
+
+ fn as_any(&self) -> &dyn (::std::any::Any) {
+ self as &dyn (::std::any::Any)
+ }
+ fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
+ self as &mut dyn (::std::any::Any)
+ }
+ fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
+ self
+ }
+
+ fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
+ Self::descriptor_static()
+ }
+
+ fn new() -> SpakeHandshakeMessage {
+ SpakeHandshakeMessage::new()
+ }
+
+ fn default_instance() -> &'static SpakeHandshakeMessage {
+ static instance: ::protobuf::rt::LazyV2<SpakeHandshakeMessage> = ::protobuf::rt::LazyV2::INIT;
+ instance.get(SpakeHandshakeMessage::new)
+ }
+}
+
+impl ::protobuf::Clear for SpakeHandshakeMessage {
+ fn clear(&mut self) {
+ self.flow_number = ::std::option::Option::None;
+ self.ec_point.clear();
+ self.hash_value.clear();
+ self.payload.clear();
+ self.unknown_fields.clear();
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for SpakeHandshakeMessage {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Message(self)
+ }
+}
+
+#[derive(Clone,PartialEq,Eq,Debug,Hash)]
+pub enum Curve {
+ ED_25519 = 1,
+}
+
+impl ::protobuf::ProtobufEnum for Curve {
+ fn value(&self) -> i32 {
+ *self as i32
+ }
+
+ fn from_i32(value: i32) -> ::std::option::Option<Curve> {
+ match value {
+ 1 => ::std::option::Option::Some(Curve::ED_25519),
+ _ => ::std::option::Option::None
+ }
+ }
+
+ fn values() -> &'static [Self] {
+ static values: &'static [Curve] = &[
+ Curve::ED_25519,
+ ];
+ values
+ }
+}
+
+impl ::std::marker::Copy for Curve {
+}
+
+// Note, `Default` is implemented although default value is not 0
+impl ::std::default::Default for Curve {
+ fn default() -> Self {
+ Curve::ED_25519
+ }
+}
+
+impl ::protobuf::reflect::ProtobufValue for Curve {
+ fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
+ ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self))
+ }
+}