// 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 3.2.0. Do not edit
// .proto file is parsed by protoc 3.19.1
// @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_results)]
#![allow(unused_mut)]

//! Generated file from `device_to_device_messages.proto`
// Generated for lite runtime

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_2_0;

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:securegcm.DeviceToDeviceMessage)
pub struct DeviceToDeviceMessage {
    // message fields
    // @@protoc_insertion_point(field:securegcm.DeviceToDeviceMessage.message)
    pub message: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:securegcm.DeviceToDeviceMessage.sequence_number)
    pub sequence_number: ::std::option::Option<i32>,
    // special fields
    // @@protoc_insertion_point(special_field:securegcm.DeviceToDeviceMessage.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 message(&self) -> &[u8] {
        match self.message.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_message(&mut self) {
        self.message = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 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 {
    const NAME: &'static str = "DeviceToDeviceMessage";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.message = ::std::option::Option::Some(is.read_bytes()?);
                },
                16 => {
                    self.sequence_number = ::std::option::Option::Some(is.read_int32()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.message.as_ref() {
            my_size += ::protobuf::rt::bytes_size(1, &v);
        }
        if let Some(v) = self.sequence_number {
            my_size += ::protobuf::rt::int32_size(2, v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(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.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> DeviceToDeviceMessage {
        DeviceToDeviceMessage::new()
    }

    fn clear(&mut self) {
        self.message = ::std::option::Option::None;
        self.sequence_number = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static DeviceToDeviceMessage {
        static instance: DeviceToDeviceMessage = DeviceToDeviceMessage {
            message: ::std::option::Option::None,
            sequence_number: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:securegcm.InitiatorHello)
pub struct InitiatorHello {
    // message fields
    // @@protoc_insertion_point(field:securegcm.InitiatorHello.public_dh_key)
    pub public_dh_key: ::protobuf::MessageField<super::securemessage::GenericPublicKey>,
    // @@protoc_insertion_point(field:securegcm.InitiatorHello.protocol_version)
    pub protocol_version: ::std::option::Option<i32>,
    // special fields
    // @@protoc_insertion_point(special_field:securegcm.InitiatorHello.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 int32 protocol_version = 2;

    pub fn 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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.public_dh_key)?;
                },
                16 => {
                    self.protocol_version = ::std::option::Option::Some(is.read_int32()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.public_dh_key.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.protocol_version {
            my_size += ::protobuf::rt::int32_size(2, v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.public_dh_key.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
        }
        if let Some(v) = self.protocol_version {
            os.write_int32(2, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> InitiatorHello {
        InitiatorHello::new()
    }

    fn clear(&mut self) {
        self.public_dh_key.clear();
        self.protocol_version = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static InitiatorHello {
        static instance: InitiatorHello = InitiatorHello {
            public_dh_key: ::protobuf::MessageField::none(),
            protocol_version: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:securegcm.ResponderHello)
pub struct ResponderHello {
    // message fields
    // @@protoc_insertion_point(field:securegcm.ResponderHello.public_dh_key)
    pub public_dh_key: ::protobuf::MessageField<super::securemessage::GenericPublicKey>,
    // @@protoc_insertion_point(field:securegcm.ResponderHello.protocol_version)
    pub protocol_version: ::std::option::Option<i32>,
    // special fields
    // @@protoc_insertion_point(special_field:securegcm.ResponderHello.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 int32 protocol_version = 2;

    pub fn 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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.public_dh_key)?;
                },
                16 => {
                    self.protocol_version = ::std::option::Option::Some(is.read_int32()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.public_dh_key.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.protocol_version {
            my_size += ::protobuf::rt::int32_size(2, v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.public_dh_key.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(1, v, os)?;
        }
        if let Some(v) = self.protocol_version {
            os.write_int32(2, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> ResponderHello {
        ResponderHello::new()
    }

    fn clear(&mut self) {
        self.public_dh_key.clear();
        self.protocol_version = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static ResponderHello {
        static instance: ResponderHello = ResponderHello {
            public_dh_key: ::protobuf::MessageField::none(),
            protocol_version: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:securegcm.EcPoint)
pub struct EcPoint {
    // message fields
    // @@protoc_insertion_point(field:securegcm.EcPoint.curve)
    pub curve: ::std::option::Option<::protobuf::EnumOrUnknown<Curve>>,
    // @@protoc_insertion_point(field:securegcm.EcPoint.x)
    pub x: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:securegcm.EcPoint.y)
    pub y: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:securegcm.EcPoint.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 curve(&self) -> Curve {
        match self.curve {
            Some(e) => e.enum_value_or(Curve::ED_25519),
            None => 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(::protobuf::EnumOrUnknown::new(v));
    }

    // required bytes x = 2;

    pub fn x(&self) -> &[u8] {
        match self.x.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_x(&mut self) {
        self.x = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 y(&self) -> &[u8] {
        match self.y.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_y(&mut self) {
        self.y = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                8 => {
                    self.curve = ::std::option::Option::Some(is.read_enum_or_unknown()?);
                },
                18 => {
                    self.x = ::std::option::Option::Some(is.read_bytes()?);
                },
                26 => {
                    self.y = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.curve {
            my_size += ::protobuf::rt::int32_size(1, v.value());
        }
        if let Some(v) = self.x.as_ref() {
            my_size += ::protobuf::rt::bytes_size(2, &v);
        }
        if let Some(v) = self.y.as_ref() {
            my_size += ::protobuf::rt::bytes_size(3, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.curve {
            os.write_enum(1, ::protobuf::EnumOrUnknown::value(&v))?;
        }
        if let Some(v) = self.x.as_ref() {
            os.write_bytes(2, v)?;
        }
        if let Some(v) = self.y.as_ref() {
            os.write_bytes(3, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> EcPoint {
        EcPoint::new()
    }

    fn clear(&mut self) {
        self.curve = ::std::option::Option::None;
        self.x = ::std::option::Option::None;
        self.y = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static EcPoint {
        static instance: EcPoint = EcPoint {
            curve: ::std::option::Option::None,
            x: ::std::option::Option::None,
            y: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(PartialEq,Clone,Default,Debug)]
// @@protoc_insertion_point(message:securegcm.SpakeHandshakeMessage)
pub struct SpakeHandshakeMessage {
    // message fields
    // @@protoc_insertion_point(field:securegcm.SpakeHandshakeMessage.flow_number)
    pub flow_number: ::std::option::Option<i32>,
    // @@protoc_insertion_point(field:securegcm.SpakeHandshakeMessage.ec_point)
    pub ec_point: ::protobuf::MessageField<EcPoint>,
    // @@protoc_insertion_point(field:securegcm.SpakeHandshakeMessage.hash_value)
    pub hash_value: ::std::option::Option<::std::vec::Vec<u8>>,
    // @@protoc_insertion_point(field:securegcm.SpakeHandshakeMessage.payload)
    pub payload: ::std::option::Option<::std::vec::Vec<u8>>,
    // special fields
    // @@protoc_insertion_point(special_field:securegcm.SpakeHandshakeMessage.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

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 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 bytes hash_value = 3;

    pub fn hash_value(&self) -> &[u8] {
        match self.hash_value.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_hash_value(&mut self) {
        self.hash_value = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 payload(&self) -> &[u8] {
        match self.payload.as_ref() {
            Some(v) => v,
            None => &[],
        }
    }

    pub fn clear_payload(&mut self) {
        self.payload = ::std::option::Option::None;
    }

    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 = ::std::option::Option::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 = ::std::option::Option::Some(::std::vec::Vec::new());
        }
        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 {
    const NAME: &'static str = "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::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                8 => {
                    self.flow_number = ::std::option::Option::Some(is.read_int32()?);
                },
                18 => {
                    ::protobuf::rt::read_singular_message_into_field(is, &mut self.ec_point)?;
                },
                26 => {
                    self.hash_value = ::std::option::Option::Some(is.read_bytes()?);
                },
                34 => {
                    self.payload = ::std::option::Option::Some(is.read_bytes()?);
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if let Some(v) = self.flow_number {
            my_size += ::protobuf::rt::int32_size(1, v);
        }
        if let Some(v) = self.ec_point.as_ref() {
            let len = v.compute_size();
            my_size += 1 + ::protobuf::rt::compute_raw_varint64_size(len) + len;
        }
        if let Some(v) = self.hash_value.as_ref() {
            my_size += ::protobuf::rt::bytes_size(3, &v);
        }
        if let Some(v) = self.payload.as_ref() {
            my_size += ::protobuf::rt::bytes_size(4, &v);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if let Some(v) = self.flow_number {
            os.write_int32(1, v)?;
        }
        if let Some(v) = self.ec_point.as_ref() {
            ::protobuf::rt::write_message_field_with_cached_size(2, v, os)?;
        }
        if let Some(v) = self.hash_value.as_ref() {
            os.write_bytes(3, v)?;
        }
        if let Some(v) = self.payload.as_ref() {
            os.write_bytes(4, v)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> SpakeHandshakeMessage {
        SpakeHandshakeMessage::new()
    }

    fn clear(&mut self) {
        self.flow_number = ::std::option::Option::None;
        self.ec_point.clear();
        self.hash_value = ::std::option::Option::None;
        self.payload = ::std::option::Option::None;
        self.special_fields.clear();
    }

    fn default_instance() -> &'static SpakeHandshakeMessage {
        static instance: SpakeHandshakeMessage = SpakeHandshakeMessage {
            flow_number: ::std::option::Option::None,
            ec_point: ::protobuf::MessageField::none(),
            hash_value: ::std::option::Option::None,
            payload: ::std::option::Option::None,
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:securegcm.Curve)
pub enum Curve {
    // @@protoc_insertion_point(enum_value:securegcm.Curve.ED_25519)
    ED_25519 = 1,
}

impl ::protobuf::Enum for Curve {
    const NAME: &'static str = "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
        }
    }

    const VALUES: &'static [Curve] = &[
        Curve::ED_25519,
    ];
}

// Note, `Default` is implemented although default value is not 0
impl ::std::default::Default for Curve {
    fn default() -> Self {
        Curve::ED_25519
    }
}

