1 // Copyright 2024 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 // This file is generated by rust-protobuf 3.2.0. Do not edit
16 // .proto file is parsed by protoc 3.21.12
17 // @generated
18 
19 // https://github.com/rust-lang/rust-clippy/issues/702
20 #![allow(unknown_lints)]
21 #![allow(clippy::all)]
22 
23 #![allow(unused_attributes)]
24 #![cfg_attr(rustfmt, rustfmt::skip)]
25 
26 #![allow(box_pointers)]
27 #![allow(dead_code)]
28 #![allow(missing_docs)]
29 #![allow(non_camel_case_types)]
30 #![allow(non_snake_case)]
31 #![allow(non_upper_case_globals)]
32 #![allow(trivial_casts)]
33 #![allow(unused_results)]
34 #![allow(unused_mut)]
35 
36 //! Generated file from `ukey.proto`
37 // Generated for lite runtime
38 
39 /// Generated files are compatible only with the same version
40 /// of protobuf runtime.
41 const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;
42 
43 #[derive(PartialEq,Clone,Default,Debug)]
44 // @@protoc_insertion_point(message:securegcm.Ukey2Message)
45 pub struct Ukey2Message {
46     // message fields
47     // @@protoc_insertion_point(field:securegcm.Ukey2Message.message_type)
48     pub message_type: ::std::option::Option<::protobuf::EnumOrUnknown<ukey2message::Type>>,
49     // @@protoc_insertion_point(field:securegcm.Ukey2Message.message_data)
50     pub message_data: ::std::option::Option<::std::vec::Vec<u8>>,
51     // special fields
52     // @@protoc_insertion_point(special_field:securegcm.Ukey2Message.special_fields)
53     pub special_fields: ::protobuf::SpecialFields,
54 }
55 
56 impl<'a> ::std::default::Default for &'a Ukey2Message {
default() -> &'a Ukey2Message57     fn default() -> &'a Ukey2Message {
58         <Ukey2Message as ::protobuf::Message>::default_instance()
59     }
60 }
61 
62 impl Ukey2Message {
new() -> Ukey2Message63     pub fn new() -> Ukey2Message {
64         ::std::default::Default::default()
65     }
66 
67     // optional .securegcm.Ukey2Message.Type message_type = 1;
68 
message_type(&self) -> ukey2message::Type69     pub fn message_type(&self) -> ukey2message::Type {
70         match self.message_type {
71             Some(e) => e.enum_value_or(ukey2message::Type::UNKNOWN_DO_NOT_USE),
72             None => ukey2message::Type::UNKNOWN_DO_NOT_USE,
73         }
74     }
75 
clear_message_type(&mut self)76     pub fn clear_message_type(&mut self) {
77         self.message_type = ::std::option::Option::None;
78     }
79 
has_message_type(&self) -> bool80     pub fn has_message_type(&self) -> bool {
81         self.message_type.is_some()
82     }
83 
84     // Param is passed by value, moved
set_message_type(&mut self, v: ukey2message::Type)85     pub fn set_message_type(&mut self, v: ukey2message::Type) {
86         self.message_type = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
87     }
88 
89     // optional bytes message_data = 2;
90 
message_data(&self) -> &[u8]91     pub fn message_data(&self) -> &[u8] {
92         match self.message_data.as_ref() {
93             Some(v) => v,
94             None => &[],
95         }
96     }
97 
clear_message_data(&mut self)98     pub fn clear_message_data(&mut self) {
99         self.message_data = ::std::option::Option::None;
100     }
101 
has_message_data(&self) -> bool102     pub fn has_message_data(&self) -> bool {
103         self.message_data.is_some()
104     }
105 
106     // Param is passed by value, moved
set_message_data(&mut self, v: ::std::vec::Vec<u8>)107     pub fn set_message_data(&mut self, v: ::std::vec::Vec<u8>) {
108         self.message_data = ::std::option::Option::Some(v);
109     }
110 
111     // Mutable pointer to the field.
112     // If field is not initialized, it is initialized with default value first.
mut_message_data(&mut self) -> &mut ::std::vec::Vec<u8>113     pub fn mut_message_data(&mut self) -> &mut ::std::vec::Vec<u8> {
114         if self.message_data.is_none() {
115             self.message_data = ::std::option::Option::Some(::std::vec::Vec::new());
116         }
117         self.message_data.as_mut().unwrap()
118     }
119 
120     // Take field
take_message_data(&mut self) -> ::std::vec::Vec<u8>121     pub fn take_message_data(&mut self) -> ::std::vec::Vec<u8> {
122         self.message_data.take().unwrap_or_else(|| ::std::vec::Vec::new())
123     }
124 }
125 
126 impl ::protobuf::Message for Ukey2Message {
127     const NAME: &'static str = "Ukey2Message";
128 
is_initialized(&self) -> bool129     fn is_initialized(&self) -> bool {
130         true
131     }
132 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>133     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
134         while let Some(tag) = is.read_raw_tag_or_eof()? {
135             match tag {
136                 8 => {
137                     self.message_type = ::std::option::Option::Some(is.read_enum_or_unknown()?);
138                 },
139                 18 => {
140                     self.message_data = ::std::option::Option::Some(is.read_bytes()?);
141                 },
142                 tag => {
143                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
144                 },
145             };
146         }
147         ::std::result::Result::Ok(())
148     }
149 
150     // Compute sizes of nested messages
151     #[allow(unused_variables)]
compute_size(&self) -> u64152     fn compute_size(&self) -> u64 {
153         let mut my_size = 0;
154         if let Some(v) = self.message_type {
155             my_size += ::protobuf::rt::int32_size(1, v.value());
156         }
157         if let Some(v) = self.message_data.as_ref() {
158             my_size += ::protobuf::rt::bytes_size(2, &v);
159         }
160         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
161         self.special_fields.cached_size().set(my_size as u32);
162         my_size
163     }
164 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>165     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
166         if let Some(v) = self.message_type {
167             os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
168         }
169         if let Some(v) = self.message_data.as_ref() {
170             os.write_bytes(2, v)?;
171         }
172         os.write_unknown_fields(self.special_fields.unknown_fields())?;
173         ::std::result::Result::Ok(())
174     }
175 
special_fields(&self) -> &::protobuf::SpecialFields176     fn special_fields(&self) -> &::protobuf::SpecialFields {
177         &self.special_fields
178     }
179 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields180     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
181         &mut self.special_fields
182     }
183 
new() -> Ukey2Message184     fn new() -> Ukey2Message {
185         Ukey2Message::new()
186     }
187 
clear(&mut self)188     fn clear(&mut self) {
189         self.message_type = ::std::option::Option::None;
190         self.message_data = ::std::option::Option::None;
191         self.special_fields.clear();
192     }
193 
default_instance() -> &'static Ukey2Message194     fn default_instance() -> &'static Ukey2Message {
195         static instance: Ukey2Message = Ukey2Message {
196             message_type: ::std::option::Option::None,
197             message_data: ::std::option::Option::None,
198             special_fields: ::protobuf::SpecialFields::new(),
199         };
200         &instance
201     }
202 }
203 
204 /// Nested message and enums of message `Ukey2Message`
205 pub mod ukey2message {
206     #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
207     // @@protoc_insertion_point(enum:securegcm.Ukey2Message.Type)
208     pub enum Type {
209         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Message.Type.UNKNOWN_DO_NOT_USE)
210         UNKNOWN_DO_NOT_USE = 0,
211         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Message.Type.ALERT)
212         ALERT = 1,
213         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Message.Type.CLIENT_INIT)
214         CLIENT_INIT = 2,
215         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Message.Type.SERVER_INIT)
216         SERVER_INIT = 3,
217         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Message.Type.CLIENT_FINISH)
218         CLIENT_FINISH = 4,
219     }
220 
221     impl ::protobuf::Enum for Type {
222         const NAME: &'static str = "Type";
223 
value(&self) -> i32224         fn value(&self) -> i32 {
225             *self as i32
226         }
227 
from_i32(value: i32) -> ::std::option::Option<Type>228         fn from_i32(value: i32) -> ::std::option::Option<Type> {
229             match value {
230                 0 => ::std::option::Option::Some(Type::UNKNOWN_DO_NOT_USE),
231                 1 => ::std::option::Option::Some(Type::ALERT),
232                 2 => ::std::option::Option::Some(Type::CLIENT_INIT),
233                 3 => ::std::option::Option::Some(Type::SERVER_INIT),
234                 4 => ::std::option::Option::Some(Type::CLIENT_FINISH),
235                 _ => ::std::option::Option::None
236             }
237         }
238 
239         const VALUES: &'static [Type] = &[
240             Type::UNKNOWN_DO_NOT_USE,
241             Type::ALERT,
242             Type::CLIENT_INIT,
243             Type::SERVER_INIT,
244             Type::CLIENT_FINISH,
245         ];
246     }
247 
248     impl ::std::default::Default for Type {
default() -> Self249         fn default() -> Self {
250             Type::UNKNOWN_DO_NOT_USE
251         }
252     }
253 
254 }
255 
256 #[derive(PartialEq,Clone,Default,Debug)]
257 // @@protoc_insertion_point(message:securegcm.Ukey2Alert)
258 pub struct Ukey2Alert {
259     // message fields
260     // @@protoc_insertion_point(field:securegcm.Ukey2Alert.type)
261     pub type_: ::std::option::Option<::protobuf::EnumOrUnknown<ukey2alert::AlertType>>,
262     // @@protoc_insertion_point(field:securegcm.Ukey2Alert.error_message)
263     pub error_message: ::std::option::Option<::std::string::String>,
264     // special fields
265     // @@protoc_insertion_point(special_field:securegcm.Ukey2Alert.special_fields)
266     pub special_fields: ::protobuf::SpecialFields,
267 }
268 
269 impl<'a> ::std::default::Default for &'a Ukey2Alert {
default() -> &'a Ukey2Alert270     fn default() -> &'a Ukey2Alert {
271         <Ukey2Alert as ::protobuf::Message>::default_instance()
272     }
273 }
274 
275 impl Ukey2Alert {
new() -> Ukey2Alert276     pub fn new() -> Ukey2Alert {
277         ::std::default::Default::default()
278     }
279 
280     // optional .securegcm.Ukey2Alert.AlertType type = 1;
281 
type_(&self) -> ukey2alert::AlertType282     pub fn type_(&self) -> ukey2alert::AlertType {
283         match self.type_ {
284             Some(e) => e.enum_value_or(ukey2alert::AlertType::BAD_MESSAGE),
285             None => ukey2alert::AlertType::BAD_MESSAGE,
286         }
287     }
288 
clear_type_(&mut self)289     pub fn clear_type_(&mut self) {
290         self.type_ = ::std::option::Option::None;
291     }
292 
has_type(&self) -> bool293     pub fn has_type(&self) -> bool {
294         self.type_.is_some()
295     }
296 
297     // Param is passed by value, moved
set_type(&mut self, v: ukey2alert::AlertType)298     pub fn set_type(&mut self, v: ukey2alert::AlertType) {
299         self.type_ = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
300     }
301 
302     // optional string error_message = 2;
303 
error_message(&self) -> &str304     pub fn error_message(&self) -> &str {
305         match self.error_message.as_ref() {
306             Some(v) => v,
307             None => "",
308         }
309     }
310 
clear_error_message(&mut self)311     pub fn clear_error_message(&mut self) {
312         self.error_message = ::std::option::Option::None;
313     }
314 
has_error_message(&self) -> bool315     pub fn has_error_message(&self) -> bool {
316         self.error_message.is_some()
317     }
318 
319     // Param is passed by value, moved
set_error_message(&mut self, v: ::std::string::String)320     pub fn set_error_message(&mut self, v: ::std::string::String) {
321         self.error_message = ::std::option::Option::Some(v);
322     }
323 
324     // Mutable pointer to the field.
325     // If field is not initialized, it is initialized with default value first.
mut_error_message(&mut self) -> &mut ::std::string::String326     pub fn mut_error_message(&mut self) -> &mut ::std::string::String {
327         if self.error_message.is_none() {
328             self.error_message = ::std::option::Option::Some(::std::string::String::new());
329         }
330         self.error_message.as_mut().unwrap()
331     }
332 
333     // Take field
take_error_message(&mut self) -> ::std::string::String334     pub fn take_error_message(&mut self) -> ::std::string::String {
335         self.error_message.take().unwrap_or_else(|| ::std::string::String::new())
336     }
337 }
338 
339 impl ::protobuf::Message for Ukey2Alert {
340     const NAME: &'static str = "Ukey2Alert";
341 
is_initialized(&self) -> bool342     fn is_initialized(&self) -> bool {
343         true
344     }
345 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>346     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
347         while let Some(tag) = is.read_raw_tag_or_eof()? {
348             match tag {
349                 8 => {
350                     self.type_ = ::std::option::Option::Some(is.read_enum_or_unknown()?);
351                 },
352                 18 => {
353                     self.error_message = ::std::option::Option::Some(is.read_string()?);
354                 },
355                 tag => {
356                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
357                 },
358             };
359         }
360         ::std::result::Result::Ok(())
361     }
362 
363     // Compute sizes of nested messages
364     #[allow(unused_variables)]
compute_size(&self) -> u64365     fn compute_size(&self) -> u64 {
366         let mut my_size = 0;
367         if let Some(v) = self.type_ {
368             my_size += ::protobuf::rt::int32_size(1, v.value());
369         }
370         if let Some(v) = self.error_message.as_ref() {
371             my_size += ::protobuf::rt::string_size(2, &v);
372         }
373         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
374         self.special_fields.cached_size().set(my_size as u32);
375         my_size
376     }
377 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>378     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
379         if let Some(v) = self.type_ {
380             os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
381         }
382         if let Some(v) = self.error_message.as_ref() {
383             os.write_string(2, v)?;
384         }
385         os.write_unknown_fields(self.special_fields.unknown_fields())?;
386         ::std::result::Result::Ok(())
387     }
388 
special_fields(&self) -> &::protobuf::SpecialFields389     fn special_fields(&self) -> &::protobuf::SpecialFields {
390         &self.special_fields
391     }
392 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields393     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
394         &mut self.special_fields
395     }
396 
new() -> Ukey2Alert397     fn new() -> Ukey2Alert {
398         Ukey2Alert::new()
399     }
400 
clear(&mut self)401     fn clear(&mut self) {
402         self.type_ = ::std::option::Option::None;
403         self.error_message = ::std::option::Option::None;
404         self.special_fields.clear();
405     }
406 
default_instance() -> &'static Ukey2Alert407     fn default_instance() -> &'static Ukey2Alert {
408         static instance: Ukey2Alert = Ukey2Alert {
409             type_: ::std::option::Option::None,
410             error_message: ::std::option::Option::None,
411             special_fields: ::protobuf::SpecialFields::new(),
412         };
413         &instance
414     }
415 }
416 
417 /// Nested message and enums of message `Ukey2Alert`
418 pub mod ukey2alert {
419     #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
420     // @@protoc_insertion_point(enum:securegcm.Ukey2Alert.AlertType)
421     pub enum AlertType {
422         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_MESSAGE)
423         BAD_MESSAGE = 1,
424         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_MESSAGE_TYPE)
425         BAD_MESSAGE_TYPE = 2,
426         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.INCORRECT_MESSAGE)
427         INCORRECT_MESSAGE = 3,
428         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_MESSAGE_DATA)
429         BAD_MESSAGE_DATA = 4,
430         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_VERSION)
431         BAD_VERSION = 100,
432         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_RANDOM)
433         BAD_RANDOM = 101,
434         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_HANDSHAKE_CIPHER)
435         BAD_HANDSHAKE_CIPHER = 102,
436         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_NEXT_PROTOCOL)
437         BAD_NEXT_PROTOCOL = 103,
438         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.BAD_PUBLIC_KEY)
439         BAD_PUBLIC_KEY = 104,
440         // @@protoc_insertion_point(enum_value:securegcm.Ukey2Alert.AlertType.INTERNAL_ERROR)
441         INTERNAL_ERROR = 200,
442     }
443 
444     impl ::protobuf::Enum for AlertType {
445         const NAME: &'static str = "AlertType";
446 
value(&self) -> i32447         fn value(&self) -> i32 {
448             *self as i32
449         }
450 
from_i32(value: i32) -> ::std::option::Option<AlertType>451         fn from_i32(value: i32) -> ::std::option::Option<AlertType> {
452             match value {
453                 1 => ::std::option::Option::Some(AlertType::BAD_MESSAGE),
454                 2 => ::std::option::Option::Some(AlertType::BAD_MESSAGE_TYPE),
455                 3 => ::std::option::Option::Some(AlertType::INCORRECT_MESSAGE),
456                 4 => ::std::option::Option::Some(AlertType::BAD_MESSAGE_DATA),
457                 100 => ::std::option::Option::Some(AlertType::BAD_VERSION),
458                 101 => ::std::option::Option::Some(AlertType::BAD_RANDOM),
459                 102 => ::std::option::Option::Some(AlertType::BAD_HANDSHAKE_CIPHER),
460                 103 => ::std::option::Option::Some(AlertType::BAD_NEXT_PROTOCOL),
461                 104 => ::std::option::Option::Some(AlertType::BAD_PUBLIC_KEY),
462                 200 => ::std::option::Option::Some(AlertType::INTERNAL_ERROR),
463                 _ => ::std::option::Option::None
464             }
465         }
466 
467         const VALUES: &'static [AlertType] = &[
468             AlertType::BAD_MESSAGE,
469             AlertType::BAD_MESSAGE_TYPE,
470             AlertType::INCORRECT_MESSAGE,
471             AlertType::BAD_MESSAGE_DATA,
472             AlertType::BAD_VERSION,
473             AlertType::BAD_RANDOM,
474             AlertType::BAD_HANDSHAKE_CIPHER,
475             AlertType::BAD_NEXT_PROTOCOL,
476             AlertType::BAD_PUBLIC_KEY,
477             AlertType::INTERNAL_ERROR,
478         ];
479     }
480 
481     // Note, `Default` is implemented although default value is not 0
482     impl ::std::default::Default for AlertType {
default() -> Self483         fn default() -> Self {
484             AlertType::BAD_MESSAGE
485         }
486     }
487 
488 }
489 
490 #[derive(PartialEq,Clone,Default,Debug)]
491 // @@protoc_insertion_point(message:securegcm.Ukey2ClientInit)
492 pub struct Ukey2ClientInit {
493     // message fields
494     // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.version)
495     pub version: ::std::option::Option<i32>,
496     // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.random)
497     pub random: ::std::option::Option<::std::vec::Vec<u8>>,
498     // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.cipher_commitments)
499     pub cipher_commitments: ::std::vec::Vec<ukey2client_init::CipherCommitment>,
500     // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.next_protocol)
501     pub next_protocol: ::std::option::Option<::std::string::String>,
502     // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.next_protocols)
503     pub next_protocols: ::std::vec::Vec<::std::string::String>,
504     // special fields
505     // @@protoc_insertion_point(special_field:securegcm.Ukey2ClientInit.special_fields)
506     pub special_fields: ::protobuf::SpecialFields,
507 }
508 
509 impl<'a> ::std::default::Default for &'a Ukey2ClientInit {
default() -> &'a Ukey2ClientInit510     fn default() -> &'a Ukey2ClientInit {
511         <Ukey2ClientInit as ::protobuf::Message>::default_instance()
512     }
513 }
514 
515 impl Ukey2ClientInit {
new() -> Ukey2ClientInit516     pub fn new() -> Ukey2ClientInit {
517         ::std::default::Default::default()
518     }
519 
520     // optional int32 version = 1;
521 
version(&self) -> i32522     pub fn version(&self) -> i32 {
523         self.version.unwrap_or(0)
524     }
525 
clear_version(&mut self)526     pub fn clear_version(&mut self) {
527         self.version = ::std::option::Option::None;
528     }
529 
has_version(&self) -> bool530     pub fn has_version(&self) -> bool {
531         self.version.is_some()
532     }
533 
534     // Param is passed by value, moved
set_version(&mut self, v: i32)535     pub fn set_version(&mut self, v: i32) {
536         self.version = ::std::option::Option::Some(v);
537     }
538 
539     // optional bytes random = 2;
540 
random(&self) -> &[u8]541     pub fn random(&self) -> &[u8] {
542         match self.random.as_ref() {
543             Some(v) => v,
544             None => &[],
545         }
546     }
547 
clear_random(&mut self)548     pub fn clear_random(&mut self) {
549         self.random = ::std::option::Option::None;
550     }
551 
has_random(&self) -> bool552     pub fn has_random(&self) -> bool {
553         self.random.is_some()
554     }
555 
556     // Param is passed by value, moved
set_random(&mut self, v: ::std::vec::Vec<u8>)557     pub fn set_random(&mut self, v: ::std::vec::Vec<u8>) {
558         self.random = ::std::option::Option::Some(v);
559     }
560 
561     // Mutable pointer to the field.
562     // If field is not initialized, it is initialized with default value first.
mut_random(&mut self) -> &mut ::std::vec::Vec<u8>563     pub fn mut_random(&mut self) -> &mut ::std::vec::Vec<u8> {
564         if self.random.is_none() {
565             self.random = ::std::option::Option::Some(::std::vec::Vec::new());
566         }
567         self.random.as_mut().unwrap()
568     }
569 
570     // Take field
take_random(&mut self) -> ::std::vec::Vec<u8>571     pub fn take_random(&mut self) -> ::std::vec::Vec<u8> {
572         self.random.take().unwrap_or_else(|| ::std::vec::Vec::new())
573     }
574 
575     // optional string next_protocol = 4;
576 
next_protocol(&self) -> &str577     pub fn next_protocol(&self) -> &str {
578         match self.next_protocol.as_ref() {
579             Some(v) => v,
580             None => "",
581         }
582     }
583 
clear_next_protocol(&mut self)584     pub fn clear_next_protocol(&mut self) {
585         self.next_protocol = ::std::option::Option::None;
586     }
587 
has_next_protocol(&self) -> bool588     pub fn has_next_protocol(&self) -> bool {
589         self.next_protocol.is_some()
590     }
591 
592     // Param is passed by value, moved
set_next_protocol(&mut self, v: ::std::string::String)593     pub fn set_next_protocol(&mut self, v: ::std::string::String) {
594         self.next_protocol = ::std::option::Option::Some(v);
595     }
596 
597     // Mutable pointer to the field.
598     // If field is not initialized, it is initialized with default value first.
mut_next_protocol(&mut self) -> &mut ::std::string::String599     pub fn mut_next_protocol(&mut self) -> &mut ::std::string::String {
600         if self.next_protocol.is_none() {
601             self.next_protocol = ::std::option::Option::Some(::std::string::String::new());
602         }
603         self.next_protocol.as_mut().unwrap()
604     }
605 
606     // Take field
take_next_protocol(&mut self) -> ::std::string::String607     pub fn take_next_protocol(&mut self) -> ::std::string::String {
608         self.next_protocol.take().unwrap_or_else(|| ::std::string::String::new())
609     }
610 }
611 
612 impl ::protobuf::Message for Ukey2ClientInit {
613     const NAME: &'static str = "Ukey2ClientInit";
614 
is_initialized(&self) -> bool615     fn is_initialized(&self) -> bool {
616         true
617     }
618 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>619     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
620         while let Some(tag) = is.read_raw_tag_or_eof()? {
621             match tag {
622                 8 => {
623                     self.version = ::std::option::Option::Some(is.read_int32()?);
624                 },
625                 18 => {
626                     self.random = ::std::option::Option::Some(is.read_bytes()?);
627                 },
628                 26 => {
629                     self.cipher_commitments.push(is.read_message()?);
630                 },
631                 34 => {
632                     self.next_protocol = ::std::option::Option::Some(is.read_string()?);
633                 },
634                 42 => {
635                     self.next_protocols.push(is.read_string()?);
636                 },
637                 tag => {
638                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
639                 },
640             };
641         }
642         ::std::result::Result::Ok(())
643     }
644 
645     // Compute sizes of nested messages
646     #[allow(unused_variables)]
compute_size(&self) -> u64647     fn compute_size(&self) -> u64 {
648         let mut my_size = 0;
649         if let Some(v) = self.version {
650             my_size += ::protobuf::rt::int32_size(1, v);
651         }
652         if let Some(v) = self.random.as_ref() {
653             my_size += ::protobuf::rt::bytes_size(2, &v);
654         }
655         for value in &self.cipher_commitments {
656             let len = value.compute_size();
657             my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
658         };
659         if let Some(v) = self.next_protocol.as_ref() {
660             my_size += ::protobuf::rt::string_size(4, &v);
661         }
662         for value in &self.next_protocols {
663             my_size += ::protobuf::rt::string_size(5, &value);
664         };
665         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
666         self.special_fields.cached_size().set(my_size as u32);
667         my_size
668     }
669 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>670     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
671         if let Some(v) = self.version {
672             os.write_int32(1, v)?;
673         }
674         if let Some(v) = self.random.as_ref() {
675             os.write_bytes(2, v)?;
676         }
677         for v in &self.cipher_commitments {
678             ::protobuf::rt::write_message_field_with_cached_size(3, v, os)?;
679         };
680         if let Some(v) = self.next_protocol.as_ref() {
681             os.write_string(4, v)?;
682         }
683         for v in &self.next_protocols {
684             os.write_string(5, &v)?;
685         };
686         os.write_unknown_fields(self.special_fields.unknown_fields())?;
687         ::std::result::Result::Ok(())
688     }
689 
special_fields(&self) -> &::protobuf::SpecialFields690     fn special_fields(&self) -> &::protobuf::SpecialFields {
691         &self.special_fields
692     }
693 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields694     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
695         &mut self.special_fields
696     }
697 
new() -> Ukey2ClientInit698     fn new() -> Ukey2ClientInit {
699         Ukey2ClientInit::new()
700     }
701 
clear(&mut self)702     fn clear(&mut self) {
703         self.version = ::std::option::Option::None;
704         self.random = ::std::option::Option::None;
705         self.cipher_commitments.clear();
706         self.next_protocol = ::std::option::Option::None;
707         self.next_protocols.clear();
708         self.special_fields.clear();
709     }
710 
default_instance() -> &'static Ukey2ClientInit711     fn default_instance() -> &'static Ukey2ClientInit {
712         static instance: Ukey2ClientInit = Ukey2ClientInit {
713             version: ::std::option::Option::None,
714             random: ::std::option::Option::None,
715             cipher_commitments: ::std::vec::Vec::new(),
716             next_protocol: ::std::option::Option::None,
717             next_protocols: ::std::vec::Vec::new(),
718             special_fields: ::protobuf::SpecialFields::new(),
719         };
720         &instance
721     }
722 }
723 
724 /// Nested message and enums of message `Ukey2ClientInit`
725 pub mod ukey2client_init {
726     #[derive(PartialEq,Clone,Default,Debug)]
727     // @@protoc_insertion_point(message:securegcm.Ukey2ClientInit.CipherCommitment)
728     pub struct CipherCommitment {
729         // message fields
730         // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.CipherCommitment.handshake_cipher)
731         pub handshake_cipher: ::std::option::Option<::protobuf::EnumOrUnknown<super::Ukey2HandshakeCipher>>,
732         // @@protoc_insertion_point(field:securegcm.Ukey2ClientInit.CipherCommitment.commitment)
733         pub commitment: ::std::option::Option<::std::vec::Vec<u8>>,
734         // special fields
735         // @@protoc_insertion_point(special_field:securegcm.Ukey2ClientInit.CipherCommitment.special_fields)
736         pub special_fields: ::protobuf::SpecialFields,
737     }
738 
739     impl<'a> ::std::default::Default for &'a CipherCommitment {
default() -> &'a CipherCommitment740         fn default() -> &'a CipherCommitment {
741             <CipherCommitment as ::protobuf::Message>::default_instance()
742         }
743     }
744 
745     impl CipherCommitment {
new() -> CipherCommitment746         pub fn new() -> CipherCommitment {
747             ::std::default::Default::default()
748         }
749 
750         // optional .securegcm.Ukey2HandshakeCipher handshake_cipher = 1;
751 
handshake_cipher(&self) -> super::Ukey2HandshakeCipher752         pub fn handshake_cipher(&self) -> super::Ukey2HandshakeCipher {
753             match self.handshake_cipher {
754                 Some(e) => e.enum_value_or(super::Ukey2HandshakeCipher::RESERVED),
755                 None => super::Ukey2HandshakeCipher::RESERVED,
756             }
757         }
758 
clear_handshake_cipher(&mut self)759         pub fn clear_handshake_cipher(&mut self) {
760             self.handshake_cipher = ::std::option::Option::None;
761         }
762 
has_handshake_cipher(&self) -> bool763         pub fn has_handshake_cipher(&self) -> bool {
764             self.handshake_cipher.is_some()
765         }
766 
767         // Param is passed by value, moved
set_handshake_cipher(&mut self, v: super::Ukey2HandshakeCipher)768         pub fn set_handshake_cipher(&mut self, v: super::Ukey2HandshakeCipher) {
769             self.handshake_cipher = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
770         }
771 
772         // optional bytes commitment = 2;
773 
commitment(&self) -> &[u8]774         pub fn commitment(&self) -> &[u8] {
775             match self.commitment.as_ref() {
776                 Some(v) => v,
777                 None => &[],
778             }
779         }
780 
clear_commitment(&mut self)781         pub fn clear_commitment(&mut self) {
782             self.commitment = ::std::option::Option::None;
783         }
784 
has_commitment(&self) -> bool785         pub fn has_commitment(&self) -> bool {
786             self.commitment.is_some()
787         }
788 
789         // Param is passed by value, moved
set_commitment(&mut self, v: ::std::vec::Vec<u8>)790         pub fn set_commitment(&mut self, v: ::std::vec::Vec<u8>) {
791             self.commitment = ::std::option::Option::Some(v);
792         }
793 
794         // Mutable pointer to the field.
795         // If field is not initialized, it is initialized with default value first.
mut_commitment(&mut self) -> &mut ::std::vec::Vec<u8>796         pub fn mut_commitment(&mut self) -> &mut ::std::vec::Vec<u8> {
797             if self.commitment.is_none() {
798                 self.commitment = ::std::option::Option::Some(::std::vec::Vec::new());
799             }
800             self.commitment.as_mut().unwrap()
801         }
802 
803         // Take field
take_commitment(&mut self) -> ::std::vec::Vec<u8>804         pub fn take_commitment(&mut self) -> ::std::vec::Vec<u8> {
805             self.commitment.take().unwrap_or_else(|| ::std::vec::Vec::new())
806         }
807     }
808 
809     impl ::protobuf::Message for CipherCommitment {
810         const NAME: &'static str = "CipherCommitment";
811 
is_initialized(&self) -> bool812         fn is_initialized(&self) -> bool {
813             true
814         }
815 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>816         fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
817             while let Some(tag) = is.read_raw_tag_or_eof()? {
818                 match tag {
819                     8 => {
820                         self.handshake_cipher = ::std::option::Option::Some(is.read_enum_or_unknown()?);
821                     },
822                     18 => {
823                         self.commitment = ::std::option::Option::Some(is.read_bytes()?);
824                     },
825                     tag => {
826                         ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
827                     },
828                 };
829             }
830             ::std::result::Result::Ok(())
831         }
832 
833         // Compute sizes of nested messages
834         #[allow(unused_variables)]
compute_size(&self) -> u64835         fn compute_size(&self) -> u64 {
836             let mut my_size = 0;
837             if let Some(v) = self.handshake_cipher {
838                 my_size += ::protobuf::rt::int32_size(1, v.value());
839             }
840             if let Some(v) = self.commitment.as_ref() {
841                 my_size += ::protobuf::rt::bytes_size(2, &v);
842             }
843             my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
844             self.special_fields.cached_size().set(my_size as u32);
845             my_size
846         }
847 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>848         fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
849             if let Some(v) = self.handshake_cipher {
850                 os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
851             }
852             if let Some(v) = self.commitment.as_ref() {
853                 os.write_bytes(2, v)?;
854             }
855             os.write_unknown_fields(self.special_fields.unknown_fields())?;
856             ::std::result::Result::Ok(())
857         }
858 
special_fields(&self) -> &::protobuf::SpecialFields859         fn special_fields(&self) -> &::protobuf::SpecialFields {
860             &self.special_fields
861         }
862 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields863         fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
864             &mut self.special_fields
865         }
866 
new() -> CipherCommitment867         fn new() -> CipherCommitment {
868             CipherCommitment::new()
869         }
870 
clear(&mut self)871         fn clear(&mut self) {
872             self.handshake_cipher = ::std::option::Option::None;
873             self.commitment = ::std::option::Option::None;
874             self.special_fields.clear();
875         }
876 
default_instance() -> &'static CipherCommitment877         fn default_instance() -> &'static CipherCommitment {
878             static instance: CipherCommitment = CipherCommitment {
879                 handshake_cipher: ::std::option::Option::None,
880                 commitment: ::std::option::Option::None,
881                 special_fields: ::protobuf::SpecialFields::new(),
882             };
883             &instance
884         }
885     }
886 }
887 
888 #[derive(PartialEq,Clone,Default,Debug)]
889 // @@protoc_insertion_point(message:securegcm.Ukey2ServerInit)
890 pub struct Ukey2ServerInit {
891     // message fields
892     // @@protoc_insertion_point(field:securegcm.Ukey2ServerInit.version)
893     pub version: ::std::option::Option<i32>,
894     // @@protoc_insertion_point(field:securegcm.Ukey2ServerInit.random)
895     pub random: ::std::option::Option<::std::vec::Vec<u8>>,
896     // @@protoc_insertion_point(field:securegcm.Ukey2ServerInit.handshake_cipher)
897     pub handshake_cipher: ::std::option::Option<::protobuf::EnumOrUnknown<Ukey2HandshakeCipher>>,
898     // @@protoc_insertion_point(field:securegcm.Ukey2ServerInit.public_key)
899     pub public_key: ::std::option::Option<::std::vec::Vec<u8>>,
900     // @@protoc_insertion_point(field:securegcm.Ukey2ServerInit.selected_next_protocol)
901     pub selected_next_protocol: ::std::option::Option<::std::string::String>,
902     // special fields
903     // @@protoc_insertion_point(special_field:securegcm.Ukey2ServerInit.special_fields)
904     pub special_fields: ::protobuf::SpecialFields,
905 }
906 
907 impl<'a> ::std::default::Default for &'a Ukey2ServerInit {
default() -> &'a Ukey2ServerInit908     fn default() -> &'a Ukey2ServerInit {
909         <Ukey2ServerInit as ::protobuf::Message>::default_instance()
910     }
911 }
912 
913 impl Ukey2ServerInit {
new() -> Ukey2ServerInit914     pub fn new() -> Ukey2ServerInit {
915         ::std::default::Default::default()
916     }
917 
918     // optional int32 version = 1;
919 
version(&self) -> i32920     pub fn version(&self) -> i32 {
921         self.version.unwrap_or(0)
922     }
923 
clear_version(&mut self)924     pub fn clear_version(&mut self) {
925         self.version = ::std::option::Option::None;
926     }
927 
has_version(&self) -> bool928     pub fn has_version(&self) -> bool {
929         self.version.is_some()
930     }
931 
932     // Param is passed by value, moved
set_version(&mut self, v: i32)933     pub fn set_version(&mut self, v: i32) {
934         self.version = ::std::option::Option::Some(v);
935     }
936 
937     // optional bytes random = 2;
938 
random(&self) -> &[u8]939     pub fn random(&self) -> &[u8] {
940         match self.random.as_ref() {
941             Some(v) => v,
942             None => &[],
943         }
944     }
945 
clear_random(&mut self)946     pub fn clear_random(&mut self) {
947         self.random = ::std::option::Option::None;
948     }
949 
has_random(&self) -> bool950     pub fn has_random(&self) -> bool {
951         self.random.is_some()
952     }
953 
954     // Param is passed by value, moved
set_random(&mut self, v: ::std::vec::Vec<u8>)955     pub fn set_random(&mut self, v: ::std::vec::Vec<u8>) {
956         self.random = ::std::option::Option::Some(v);
957     }
958 
959     // Mutable pointer to the field.
960     // If field is not initialized, it is initialized with default value first.
mut_random(&mut self) -> &mut ::std::vec::Vec<u8>961     pub fn mut_random(&mut self) -> &mut ::std::vec::Vec<u8> {
962         if self.random.is_none() {
963             self.random = ::std::option::Option::Some(::std::vec::Vec::new());
964         }
965         self.random.as_mut().unwrap()
966     }
967 
968     // Take field
take_random(&mut self) -> ::std::vec::Vec<u8>969     pub fn take_random(&mut self) -> ::std::vec::Vec<u8> {
970         self.random.take().unwrap_or_else(|| ::std::vec::Vec::new())
971     }
972 
973     // optional .securegcm.Ukey2HandshakeCipher handshake_cipher = 3;
974 
handshake_cipher(&self) -> Ukey2HandshakeCipher975     pub fn handshake_cipher(&self) -> Ukey2HandshakeCipher {
976         match self.handshake_cipher {
977             Some(e) => e.enum_value_or(Ukey2HandshakeCipher::RESERVED),
978             None => Ukey2HandshakeCipher::RESERVED,
979         }
980     }
981 
clear_handshake_cipher(&mut self)982     pub fn clear_handshake_cipher(&mut self) {
983         self.handshake_cipher = ::std::option::Option::None;
984     }
985 
has_handshake_cipher(&self) -> bool986     pub fn has_handshake_cipher(&self) -> bool {
987         self.handshake_cipher.is_some()
988     }
989 
990     // Param is passed by value, moved
set_handshake_cipher(&mut self, v: Ukey2HandshakeCipher)991     pub fn set_handshake_cipher(&mut self, v: Ukey2HandshakeCipher) {
992         self.handshake_cipher = ::std::option::Option::Some(::protobuf::EnumOrUnknown::new(v));
993     }
994 
995     // optional bytes public_key = 4;
996 
public_key(&self) -> &[u8]997     pub fn public_key(&self) -> &[u8] {
998         match self.public_key.as_ref() {
999             Some(v) => v,
1000             None => &[],
1001         }
1002     }
1003 
clear_public_key(&mut self)1004     pub fn clear_public_key(&mut self) {
1005         self.public_key = ::std::option::Option::None;
1006     }
1007 
has_public_key(&self) -> bool1008     pub fn has_public_key(&self) -> bool {
1009         self.public_key.is_some()
1010     }
1011 
1012     // Param is passed by value, moved
set_public_key(&mut self, v: ::std::vec::Vec<u8>)1013     pub fn set_public_key(&mut self, v: ::std::vec::Vec<u8>) {
1014         self.public_key = ::std::option::Option::Some(v);
1015     }
1016 
1017     // Mutable pointer to the field.
1018     // If field is not initialized, it is initialized with default value first.
mut_public_key(&mut self) -> &mut ::std::vec::Vec<u8>1019     pub fn mut_public_key(&mut self) -> &mut ::std::vec::Vec<u8> {
1020         if self.public_key.is_none() {
1021             self.public_key = ::std::option::Option::Some(::std::vec::Vec::new());
1022         }
1023         self.public_key.as_mut().unwrap()
1024     }
1025 
1026     // Take field
take_public_key(&mut self) -> ::std::vec::Vec<u8>1027     pub fn take_public_key(&mut self) -> ::std::vec::Vec<u8> {
1028         self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new())
1029     }
1030 
1031     // optional string selected_next_protocol = 5;
1032 
selected_next_protocol(&self) -> &str1033     pub fn selected_next_protocol(&self) -> &str {
1034         match self.selected_next_protocol.as_ref() {
1035             Some(v) => v,
1036             None => "",
1037         }
1038     }
1039 
clear_selected_next_protocol(&mut self)1040     pub fn clear_selected_next_protocol(&mut self) {
1041         self.selected_next_protocol = ::std::option::Option::None;
1042     }
1043 
has_selected_next_protocol(&self) -> bool1044     pub fn has_selected_next_protocol(&self) -> bool {
1045         self.selected_next_protocol.is_some()
1046     }
1047 
1048     // Param is passed by value, moved
set_selected_next_protocol(&mut self, v: ::std::string::String)1049     pub fn set_selected_next_protocol(&mut self, v: ::std::string::String) {
1050         self.selected_next_protocol = ::std::option::Option::Some(v);
1051     }
1052 
1053     // Mutable pointer to the field.
1054     // If field is not initialized, it is initialized with default value first.
mut_selected_next_protocol(&mut self) -> &mut ::std::string::String1055     pub fn mut_selected_next_protocol(&mut self) -> &mut ::std::string::String {
1056         if self.selected_next_protocol.is_none() {
1057             self.selected_next_protocol = ::std::option::Option::Some(::std::string::String::new());
1058         }
1059         self.selected_next_protocol.as_mut().unwrap()
1060     }
1061 
1062     // Take field
take_selected_next_protocol(&mut self) -> ::std::string::String1063     pub fn take_selected_next_protocol(&mut self) -> ::std::string::String {
1064         self.selected_next_protocol.take().unwrap_or_else(|| ::std::string::String::new())
1065     }
1066 }
1067 
1068 impl ::protobuf::Message for Ukey2ServerInit {
1069     const NAME: &'static str = "Ukey2ServerInit";
1070 
is_initialized(&self) -> bool1071     fn is_initialized(&self) -> bool {
1072         true
1073     }
1074 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1075     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1076         while let Some(tag) = is.read_raw_tag_or_eof()? {
1077             match tag {
1078                 8 => {
1079                     self.version = ::std::option::Option::Some(is.read_int32()?);
1080                 },
1081                 18 => {
1082                     self.random = ::std::option::Option::Some(is.read_bytes()?);
1083                 },
1084                 24 => {
1085                     self.handshake_cipher = ::std::option::Option::Some(is.read_enum_or_unknown()?);
1086                 },
1087                 34 => {
1088                     self.public_key = ::std::option::Option::Some(is.read_bytes()?);
1089                 },
1090                 42 => {
1091                     self.selected_next_protocol = ::std::option::Option::Some(is.read_string()?);
1092                 },
1093                 tag => {
1094                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1095                 },
1096             };
1097         }
1098         ::std::result::Result::Ok(())
1099     }
1100 
1101     // Compute sizes of nested messages
1102     #[allow(unused_variables)]
compute_size(&self) -> u641103     fn compute_size(&self) -> u64 {
1104         let mut my_size = 0;
1105         if let Some(v) = self.version {
1106             my_size += ::protobuf::rt::int32_size(1, v);
1107         }
1108         if let Some(v) = self.random.as_ref() {
1109             my_size += ::protobuf::rt::bytes_size(2, &v);
1110         }
1111         if let Some(v) = self.handshake_cipher {
1112             my_size += ::protobuf::rt::int32_size(3, v.value());
1113         }
1114         if let Some(v) = self.public_key.as_ref() {
1115             my_size += ::protobuf::rt::bytes_size(4, &v);
1116         }
1117         if let Some(v) = self.selected_next_protocol.as_ref() {
1118             my_size += ::protobuf::rt::string_size(5, &v);
1119         }
1120         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1121         self.special_fields.cached_size().set(my_size as u32);
1122         my_size
1123     }
1124 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1125     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1126         if let Some(v) = self.version {
1127             os.write_int32(1, v)?;
1128         }
1129         if let Some(v) = self.random.as_ref() {
1130             os.write_bytes(2, v)?;
1131         }
1132         if let Some(v) = self.handshake_cipher {
1133             os.write_enum(3, ::protobuf::EnumOrUnknown::value(&v))?;
1134         }
1135         if let Some(v) = self.public_key.as_ref() {
1136             os.write_bytes(4, v)?;
1137         }
1138         if let Some(v) = self.selected_next_protocol.as_ref() {
1139             os.write_string(5, v)?;
1140         }
1141         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1142         ::std::result::Result::Ok(())
1143     }
1144 
special_fields(&self) -> &::protobuf::SpecialFields1145     fn special_fields(&self) -> &::protobuf::SpecialFields {
1146         &self.special_fields
1147     }
1148 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1149     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1150         &mut self.special_fields
1151     }
1152 
new() -> Ukey2ServerInit1153     fn new() -> Ukey2ServerInit {
1154         Ukey2ServerInit::new()
1155     }
1156 
clear(&mut self)1157     fn clear(&mut self) {
1158         self.version = ::std::option::Option::None;
1159         self.random = ::std::option::Option::None;
1160         self.handshake_cipher = ::std::option::Option::None;
1161         self.public_key = ::std::option::Option::None;
1162         self.selected_next_protocol = ::std::option::Option::None;
1163         self.special_fields.clear();
1164     }
1165 
default_instance() -> &'static Ukey2ServerInit1166     fn default_instance() -> &'static Ukey2ServerInit {
1167         static instance: Ukey2ServerInit = Ukey2ServerInit {
1168             version: ::std::option::Option::None,
1169             random: ::std::option::Option::None,
1170             handshake_cipher: ::std::option::Option::None,
1171             public_key: ::std::option::Option::None,
1172             selected_next_protocol: ::std::option::Option::None,
1173             special_fields: ::protobuf::SpecialFields::new(),
1174         };
1175         &instance
1176     }
1177 }
1178 
1179 #[derive(PartialEq,Clone,Default,Debug)]
1180 // @@protoc_insertion_point(message:securegcm.Ukey2ClientFinished)
1181 pub struct Ukey2ClientFinished {
1182     // message fields
1183     // @@protoc_insertion_point(field:securegcm.Ukey2ClientFinished.public_key)
1184     pub public_key: ::std::option::Option<::std::vec::Vec<u8>>,
1185     // special fields
1186     // @@protoc_insertion_point(special_field:securegcm.Ukey2ClientFinished.special_fields)
1187     pub special_fields: ::protobuf::SpecialFields,
1188 }
1189 
1190 impl<'a> ::std::default::Default for &'a Ukey2ClientFinished {
default() -> &'a Ukey2ClientFinished1191     fn default() -> &'a Ukey2ClientFinished {
1192         <Ukey2ClientFinished as ::protobuf::Message>::default_instance()
1193     }
1194 }
1195 
1196 impl Ukey2ClientFinished {
new() -> Ukey2ClientFinished1197     pub fn new() -> Ukey2ClientFinished {
1198         ::std::default::Default::default()
1199     }
1200 
1201     // optional bytes public_key = 1;
1202 
public_key(&self) -> &[u8]1203     pub fn public_key(&self) -> &[u8] {
1204         match self.public_key.as_ref() {
1205             Some(v) => v,
1206             None => &[],
1207         }
1208     }
1209 
clear_public_key(&mut self)1210     pub fn clear_public_key(&mut self) {
1211         self.public_key = ::std::option::Option::None;
1212     }
1213 
has_public_key(&self) -> bool1214     pub fn has_public_key(&self) -> bool {
1215         self.public_key.is_some()
1216     }
1217 
1218     // Param is passed by value, moved
set_public_key(&mut self, v: ::std::vec::Vec<u8>)1219     pub fn set_public_key(&mut self, v: ::std::vec::Vec<u8>) {
1220         self.public_key = ::std::option::Option::Some(v);
1221     }
1222 
1223     // Mutable pointer to the field.
1224     // If field is not initialized, it is initialized with default value first.
mut_public_key(&mut self) -> &mut ::std::vec::Vec<u8>1225     pub fn mut_public_key(&mut self) -> &mut ::std::vec::Vec<u8> {
1226         if self.public_key.is_none() {
1227             self.public_key = ::std::option::Option::Some(::std::vec::Vec::new());
1228         }
1229         self.public_key.as_mut().unwrap()
1230     }
1231 
1232     // Take field
take_public_key(&mut self) -> ::std::vec::Vec<u8>1233     pub fn take_public_key(&mut self) -> ::std::vec::Vec<u8> {
1234         self.public_key.take().unwrap_or_else(|| ::std::vec::Vec::new())
1235     }
1236 }
1237 
1238 impl ::protobuf::Message for Ukey2ClientFinished {
1239     const NAME: &'static str = "Ukey2ClientFinished";
1240 
is_initialized(&self) -> bool1241     fn is_initialized(&self) -> bool {
1242         true
1243     }
1244 
merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()>1245     fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
1246         while let Some(tag) = is.read_raw_tag_or_eof()? {
1247             match tag {
1248                 10 => {
1249                     self.public_key = ::std::option::Option::Some(is.read_bytes()?);
1250                 },
1251                 tag => {
1252                     ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
1253                 },
1254             };
1255         }
1256         ::std::result::Result::Ok(())
1257     }
1258 
1259     // Compute sizes of nested messages
1260     #[allow(unused_variables)]
compute_size(&self) -> u641261     fn compute_size(&self) -> u64 {
1262         let mut my_size = 0;
1263         if let Some(v) = self.public_key.as_ref() {
1264             my_size += ::protobuf::rt::bytes_size(1, &v);
1265         }
1266         my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
1267         self.special_fields.cached_size().set(my_size as u32);
1268         my_size
1269     }
1270 
write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()>1271     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
1272         if let Some(v) = self.public_key.as_ref() {
1273             os.write_bytes(1, v)?;
1274         }
1275         os.write_unknown_fields(self.special_fields.unknown_fields())?;
1276         ::std::result::Result::Ok(())
1277     }
1278 
special_fields(&self) -> &::protobuf::SpecialFields1279     fn special_fields(&self) -> &::protobuf::SpecialFields {
1280         &self.special_fields
1281     }
1282 
mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields1283     fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
1284         &mut self.special_fields
1285     }
1286 
new() -> Ukey2ClientFinished1287     fn new() -> Ukey2ClientFinished {
1288         Ukey2ClientFinished::new()
1289     }
1290 
clear(&mut self)1291     fn clear(&mut self) {
1292         self.public_key = ::std::option::Option::None;
1293         self.special_fields.clear();
1294     }
1295 
default_instance() -> &'static Ukey2ClientFinished1296     fn default_instance() -> &'static Ukey2ClientFinished {
1297         static instance: Ukey2ClientFinished = Ukey2ClientFinished {
1298             public_key: ::std::option::Option::None,
1299             special_fields: ::protobuf::SpecialFields::new(),
1300         };
1301         &instance
1302     }
1303 }
1304 
1305 #[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
1306 // @@protoc_insertion_point(enum:securegcm.Ukey2HandshakeCipher)
1307 pub enum Ukey2HandshakeCipher {
1308     // @@protoc_insertion_point(enum_value:securegcm.Ukey2HandshakeCipher.RESERVED)
1309     RESERVED = 0,
1310     // @@protoc_insertion_point(enum_value:securegcm.Ukey2HandshakeCipher.P256_SHA512)
1311     P256_SHA512 = 100,
1312     // @@protoc_insertion_point(enum_value:securegcm.Ukey2HandshakeCipher.CURVE25519_SHA512)
1313     CURVE25519_SHA512 = 200,
1314 }
1315 
1316 impl ::protobuf::Enum for Ukey2HandshakeCipher {
1317     const NAME: &'static str = "Ukey2HandshakeCipher";
1318 
value(&self) -> i321319     fn value(&self) -> i32 {
1320         *self as i32
1321     }
1322 
from_i32(value: i32) -> ::std::option::Option<Ukey2HandshakeCipher>1323     fn from_i32(value: i32) -> ::std::option::Option<Ukey2HandshakeCipher> {
1324         match value {
1325             0 => ::std::option::Option::Some(Ukey2HandshakeCipher::RESERVED),
1326             100 => ::std::option::Option::Some(Ukey2HandshakeCipher::P256_SHA512),
1327             200 => ::std::option::Option::Some(Ukey2HandshakeCipher::CURVE25519_SHA512),
1328             _ => ::std::option::Option::None
1329         }
1330     }
1331 
1332     const VALUES: &'static [Ukey2HandshakeCipher] = &[
1333         Ukey2HandshakeCipher::RESERVED,
1334         Ukey2HandshakeCipher::P256_SHA512,
1335         Ukey2HandshakeCipher::CURVE25519_SHA512,
1336     ];
1337 }
1338 
1339 impl ::std::default::Default for Ukey2HandshakeCipher {
default() -> Self1340     fn default() -> Self {
1341         Ukey2HandshakeCipher::RESERVED
1342     }
1343 }
1344 
1345