// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: proto/securemessage.proto

#include "proto/securemessage.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG
namespace securemessage {
constexpr SecureMessage::SecureMessage(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : header_and_body_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , signature_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct SecureMessageDefaultTypeInternal {
  constexpr SecureMessageDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~SecureMessageDefaultTypeInternal() {}
  union {
    SecureMessage _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SecureMessageDefaultTypeInternal _SecureMessage_default_instance_;
constexpr Header::Header(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : verification_key_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , decryption_key_id_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , iv_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , public_metadata_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , associated_data_length_(0u)
  , signature_scheme_(1)

  , encryption_scheme_(1)
{}
struct HeaderDefaultTypeInternal {
  constexpr HeaderDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~HeaderDefaultTypeInternal() {}
  union {
    Header _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HeaderDefaultTypeInternal _Header_default_instance_;
constexpr HeaderAndBody::HeaderAndBody(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : body_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , header_(nullptr){}
struct HeaderAndBodyDefaultTypeInternal {
  constexpr HeaderAndBodyDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~HeaderAndBodyDefaultTypeInternal() {}
  union {
    HeaderAndBody _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HeaderAndBodyDefaultTypeInternal _HeaderAndBody_default_instance_;
constexpr HeaderAndBodyInternal::HeaderAndBodyInternal(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : header_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , body_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct HeaderAndBodyInternalDefaultTypeInternal {
  constexpr HeaderAndBodyInternalDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~HeaderAndBodyInternalDefaultTypeInternal() {}
  union {
    HeaderAndBodyInternal _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT HeaderAndBodyInternalDefaultTypeInternal _HeaderAndBodyInternal_default_instance_;
constexpr EcP256PublicKey::EcP256PublicKey(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : x_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , y_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct EcP256PublicKeyDefaultTypeInternal {
  constexpr EcP256PublicKeyDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~EcP256PublicKeyDefaultTypeInternal() {}
  union {
    EcP256PublicKey _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT EcP256PublicKeyDefaultTypeInternal _EcP256PublicKey_default_instance_;
constexpr SimpleRsaPublicKey::SimpleRsaPublicKey(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : n_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , e_(65537){}
struct SimpleRsaPublicKeyDefaultTypeInternal {
  constexpr SimpleRsaPublicKeyDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~SimpleRsaPublicKeyDefaultTypeInternal() {}
  union {
    SimpleRsaPublicKey _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT SimpleRsaPublicKeyDefaultTypeInternal _SimpleRsaPublicKey_default_instance_;
constexpr DhPublicKey::DhPublicKey(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : y_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct DhPublicKeyDefaultTypeInternal {
  constexpr DhPublicKeyDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~DhPublicKeyDefaultTypeInternal() {}
  union {
    DhPublicKey _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DhPublicKeyDefaultTypeInternal _DhPublicKey_default_instance_;
constexpr GenericPublicKey::GenericPublicKey(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : ec_p256_public_key_(nullptr)
  , rsa2048_public_key_(nullptr)
  , dh2048_public_key_(nullptr)
  , type_(1)
{}
struct GenericPublicKeyDefaultTypeInternal {
  constexpr GenericPublicKeyDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~GenericPublicKeyDefaultTypeInternal() {}
  union {
    GenericPublicKey _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GenericPublicKeyDefaultTypeInternal _GenericPublicKey_default_instance_;
}  // namespace securemessage
namespace securemessage {
bool SigScheme_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> SigScheme_strings[3] = {};

static const char SigScheme_names[] =
  "ECDSA_P256_SHA256"
  "HMAC_SHA256"
  "RSA2048_SHA256";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SigScheme_entries[] = {
  { {SigScheme_names + 0, 17}, 2 },
  { {SigScheme_names + 17, 11}, 1 },
  { {SigScheme_names + 28, 14}, 3 },
};

static const int SigScheme_entries_by_number[] = {
  1, // 1 -> HMAC_SHA256
  0, // 2 -> ECDSA_P256_SHA256
  2, // 3 -> RSA2048_SHA256
};

const std::string& SigScheme_Name(
    SigScheme value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          SigScheme_entries,
          SigScheme_entries_by_number,
          3, SigScheme_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      SigScheme_entries,
      SigScheme_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     SigScheme_strings[idx].get();
}
bool SigScheme_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SigScheme* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      SigScheme_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<SigScheme>(int_value);
  }
  return success;
}
bool EncScheme_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> EncScheme_strings[2] = {};

static const char EncScheme_names[] =
  "AES_256_CBC"
  "NONE";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry EncScheme_entries[] = {
  { {EncScheme_names + 0, 11}, 2 },
  { {EncScheme_names + 11, 4}, 1 },
};

static const int EncScheme_entries_by_number[] = {
  1, // 1 -> NONE
  0, // 2 -> AES_256_CBC
};

const std::string& EncScheme_Name(
    EncScheme value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          EncScheme_entries,
          EncScheme_entries_by_number,
          2, EncScheme_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      EncScheme_entries,
      EncScheme_entries_by_number,
      2, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     EncScheme_strings[idx].get();
}
bool EncScheme_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, EncScheme* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      EncScheme_entries, 2, name, &int_value);
  if (success) {
    *value = static_cast<EncScheme>(int_value);
  }
  return success;
}
bool PublicKeyType_IsValid(int value) {
  switch (value) {
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PublicKeyType_strings[3] = {};

static const char PublicKeyType_names[] =
  "DH2048_MODP"
  "EC_P256"
  "RSA2048";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PublicKeyType_entries[] = {
  { {PublicKeyType_names + 0, 11}, 3 },
  { {PublicKeyType_names + 11, 7}, 1 },
  { {PublicKeyType_names + 18, 7}, 2 },
};

static const int PublicKeyType_entries_by_number[] = {
  1, // 1 -> EC_P256
  2, // 2 -> RSA2048
  0, // 3 -> DH2048_MODP
};

const std::string& PublicKeyType_Name(
    PublicKeyType value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          PublicKeyType_entries,
          PublicKeyType_entries_by_number,
          3, PublicKeyType_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      PublicKeyType_entries,
      PublicKeyType_entries_by_number,
      3, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     PublicKeyType_strings[idx].get();
}
bool PublicKeyType_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PublicKeyType* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      PublicKeyType_entries, 3, name, &int_value);
  if (success) {
    *value = static_cast<PublicKeyType>(int_value);
  }
  return success;
}

// ===================================================================

class SecureMessage::_Internal {
 public:
  using HasBits = decltype(std::declval<SecureMessage>()._has_bits_);
  static void set_has_header_and_body(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_signature(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
  }
};

SecureMessage::SecureMessage(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.SecureMessage)
}
SecureMessage::SecureMessage(const SecureMessage& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  header_and_body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    header_and_body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_header_and_body()) {
    header_and_body_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_header_and_body(), 
      GetArenaForAllocation());
  }
  signature_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    signature_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_signature()) {
    signature_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_signature(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:securemessage.SecureMessage)
}

inline void SecureMessage::SharedCtor() {
header_and_body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  header_and_body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
signature_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  signature_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

SecureMessage::~SecureMessage() {
  // @@protoc_insertion_point(destructor:securemessage.SecureMessage)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void SecureMessage::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  header_and_body_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  signature_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void SecureMessage::ArenaDtor(void* object) {
  SecureMessage* _this = reinterpret_cast< SecureMessage* >(object);
  (void)_this;
}
void SecureMessage::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void SecureMessage::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void SecureMessage::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.SecureMessage)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      header_and_body_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      signature_.ClearNonDefaultToEmpty();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* SecureMessage::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required bytes header_and_body = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_header_and_body();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // required bytes signature = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_signature();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* SecureMessage::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.SecureMessage)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required bytes header_and_body = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_header_and_body(), target);
  }

  // required bytes signature = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_signature(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.SecureMessage)
  return target;
}

size_t SecureMessage::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:securemessage.SecureMessage)
  size_t total_size = 0;

  if (_internal_has_header_and_body()) {
    // required bytes header_and_body = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_header_and_body());
  }

  if (_internal_has_signature()) {
    // required bytes signature = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_signature());
  }

  return total_size;
}
size_t SecureMessage::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.SecureMessage)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required bytes header_and_body = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_header_and_body());

    // required bytes signature = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_signature());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void SecureMessage::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SecureMessage*>(
      &from));
}

void SecureMessage::MergeFrom(const SecureMessage& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.SecureMessage)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_header_and_body(from._internal_header_and_body());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_signature(from._internal_signature());
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void SecureMessage::CopyFrom(const SecureMessage& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.SecureMessage)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SecureMessage::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void SecureMessage::InternalSwap(SecureMessage* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &header_and_body_, lhs_arena,
      &other->header_and_body_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &signature_, lhs_arena,
      &other->signature_, rhs_arena
  );
}

std::string SecureMessage::GetTypeName() const {
  return "securemessage.SecureMessage";
}


// ===================================================================

class Header::_Internal {
 public:
  using HasBits = decltype(std::declval<Header>()._has_bits_);
  static void set_has_signature_scheme(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_encryption_scheme(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_verification_key_id(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_decryption_key_id(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_iv(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_public_metadata(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_associated_data_length(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000060) ^ 0x00000060) != 0;
  }
};

Header::Header(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.Header)
}
Header::Header(const Header& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  verification_key_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    verification_key_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_verification_key_id()) {
    verification_key_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_verification_key_id(), 
      GetArenaForAllocation());
  }
  decryption_key_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    decryption_key_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_decryption_key_id()) {
    decryption_key_id_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_decryption_key_id(), 
      GetArenaForAllocation());
  }
  iv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    iv_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_iv()) {
    iv_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_iv(), 
      GetArenaForAllocation());
  }
  public_metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    public_metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_public_metadata()) {
    public_metadata_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_public_metadata(), 
      GetArenaForAllocation());
  }
  ::memcpy(&associated_data_length_, &from.associated_data_length_,
    static_cast<size_t>(reinterpret_cast<char*>(&encryption_scheme_) -
    reinterpret_cast<char*>(&associated_data_length_)) + sizeof(encryption_scheme_));
  // @@protoc_insertion_point(copy_constructor:securemessage.Header)
}

inline void Header::SharedCtor() {
verification_key_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  verification_key_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
decryption_key_id_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  decryption_key_id_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
iv_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  iv_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
public_metadata_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  public_metadata_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
associated_data_length_ = 0u;
signature_scheme_ = 1;
encryption_scheme_ = 1;
}

Header::~Header() {
  // @@protoc_insertion_point(destructor:securemessage.Header)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void Header::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  verification_key_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  decryption_key_id_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  iv_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  public_metadata_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void Header::ArenaDtor(void* object) {
  Header* _this = reinterpret_cast< Header* >(object);
  (void)_this;
}
void Header::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Header::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void Header::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.Header)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      verification_key_id_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      decryption_key_id_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      iv_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000008u) {
      public_metadata_.ClearNonDefaultToEmpty();
    }
  }
  if (cached_has_bits & 0x00000070u) {
    associated_data_length_ = 0u;
    signature_scheme_ = 1;
    encryption_scheme_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* Header::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required .securemessage.SigScheme signature_scheme = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::securemessage::SigScheme_IsValid(val))) {
            _internal_set_signature_scheme(static_cast<::securemessage::SigScheme>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // required .securemessage.EncScheme encryption_scheme = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::securemessage::EncScheme_IsValid(val))) {
            _internal_set_encryption_scheme(static_cast<::securemessage::EncScheme>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional bytes verification_key_id = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_verification_key_id();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bytes decryption_key_id = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          auto str = _internal_mutable_decryption_key_id();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bytes iv = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_iv();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bytes public_metadata = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          auto str = _internal_mutable_public_metadata();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional uint32 associated_data_length = 7 [default = 0];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_associated_data_length(&has_bits);
          associated_data_length_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Header::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.Header)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .securemessage.SigScheme signature_scheme = 1;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_signature_scheme(), target);
  }

  // required .securemessage.EncScheme encryption_scheme = 2;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      2, this->_internal_encryption_scheme(), target);
  }

  // optional bytes verification_key_id = 3;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        3, this->_internal_verification_key_id(), target);
  }

  // optional bytes decryption_key_id = 4;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteBytesMaybeAliased(
        4, this->_internal_decryption_key_id(), target);
  }

  // optional bytes iv = 5;
  if (cached_has_bits & 0x00000004u) {
    target = stream->WriteBytesMaybeAliased(
        5, this->_internal_iv(), target);
  }

  // optional bytes public_metadata = 6;
  if (cached_has_bits & 0x00000008u) {
    target = stream->WriteBytesMaybeAliased(
        6, this->_internal_public_metadata(), target);
  }

  // optional uint32 associated_data_length = 7 [default = 0];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(7, this->_internal_associated_data_length(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.Header)
  return target;
}

size_t Header::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:securemessage.Header)
  size_t total_size = 0;

  if (_internal_has_signature_scheme()) {
    // required .securemessage.SigScheme signature_scheme = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_signature_scheme());
  }

  if (_internal_has_encryption_scheme()) {
    // required .securemessage.EncScheme encryption_scheme = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_encryption_scheme());
  }

  return total_size;
}
size_t Header::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.Header)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000060) ^ 0x00000060) == 0) {  // All required fields are present.
    // required .securemessage.SigScheme signature_scheme = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_signature_scheme());

    // required .securemessage.EncScheme encryption_scheme = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_encryption_scheme());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    // optional bytes verification_key_id = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_verification_key_id());
    }

    // optional bytes decryption_key_id = 4;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_decryption_key_id());
    }

    // optional bytes iv = 5;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_iv());
    }

    // optional bytes public_metadata = 6;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
          this->_internal_public_metadata());
    }

    // optional uint32 associated_data_length = 7 [default = 0];
    if (cached_has_bits & 0x00000010u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32SizePlusOne(this->_internal_associated_data_length());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Header::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const Header*>(
      &from));
}

void Header::MergeFrom(const Header& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.Header)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000007fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_verification_key_id(from._internal_verification_key_id());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_decryption_key_id(from._internal_decryption_key_id());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_set_iv(from._internal_iv());
    }
    if (cached_has_bits & 0x00000008u) {
      _internal_set_public_metadata(from._internal_public_metadata());
    }
    if (cached_has_bits & 0x00000010u) {
      associated_data_length_ = from.associated_data_length_;
    }
    if (cached_has_bits & 0x00000020u) {
      signature_scheme_ = from.signature_scheme_;
    }
    if (cached_has_bits & 0x00000040u) {
      encryption_scheme_ = from.encryption_scheme_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void Header::CopyFrom(const Header& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.Header)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Header::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void Header::InternalSwap(Header* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &verification_key_id_, lhs_arena,
      &other->verification_key_id_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &decryption_key_id_, lhs_arena,
      &other->decryption_key_id_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &iv_, lhs_arena,
      &other->iv_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &public_metadata_, lhs_arena,
      &other->public_metadata_, rhs_arena
  );
  swap(associated_data_length_, other->associated_data_length_);
  swap(signature_scheme_, other->signature_scheme_);
  swap(encryption_scheme_, other->encryption_scheme_);
}

std::string Header::GetTypeName() const {
  return "securemessage.Header";
}


// ===================================================================

class HeaderAndBody::_Internal {
 public:
  using HasBits = decltype(std::declval<HeaderAndBody>()._has_bits_);
  static const ::securemessage::Header& header(const HeaderAndBody* msg);
  static void set_has_header(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_body(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
  }
};

const ::securemessage::Header&
HeaderAndBody::_Internal::header(const HeaderAndBody* msg) {
  return *msg->header_;
}
HeaderAndBody::HeaderAndBody(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.HeaderAndBody)
}
HeaderAndBody::HeaderAndBody(const HeaderAndBody& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_body()) {
    body_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_body(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_header()) {
    header_ = new ::securemessage::Header(*from.header_);
  } else {
    header_ = nullptr;
  }
  // @@protoc_insertion_point(copy_constructor:securemessage.HeaderAndBody)
}

inline void HeaderAndBody::SharedCtor() {
body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
header_ = nullptr;
}

HeaderAndBody::~HeaderAndBody() {
  // @@protoc_insertion_point(destructor:securemessage.HeaderAndBody)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void HeaderAndBody::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  body_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete header_;
}

void HeaderAndBody::ArenaDtor(void* object) {
  HeaderAndBody* _this = reinterpret_cast< HeaderAndBody* >(object);
  (void)_this;
}
void HeaderAndBody::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void HeaderAndBody::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void HeaderAndBody::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.HeaderAndBody)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      body_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(header_ != nullptr);
      header_->Clear();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* HeaderAndBody::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required .securemessage.Header header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_header(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // required bytes body = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_body();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* HeaderAndBody::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.HeaderAndBody)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .securemessage.Header header = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        1, _Internal::header(this), target, stream);
  }

  // required bytes body = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_body(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.HeaderAndBody)
  return target;
}

size_t HeaderAndBody::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:securemessage.HeaderAndBody)
  size_t total_size = 0;

  if (_internal_has_body()) {
    // required bytes body = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_body());
  }

  if (_internal_has_header()) {
    // required .securemessage.Header header = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *header_);
  }

  return total_size;
}
size_t HeaderAndBody::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.HeaderAndBody)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required bytes body = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_body());

    // required .securemessage.Header header = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
        *header_);

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HeaderAndBody::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HeaderAndBody*>(
      &from));
}

void HeaderAndBody::MergeFrom(const HeaderAndBody& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.HeaderAndBody)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_body(from._internal_body());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_header()->::securemessage::Header::MergeFrom(from._internal_header());
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void HeaderAndBody::CopyFrom(const HeaderAndBody& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.HeaderAndBody)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderAndBody::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  if (_internal_has_header()) {
    if (!header_->IsInitialized()) return false;
  }
  return true;
}

void HeaderAndBody::InternalSwap(HeaderAndBody* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &body_, lhs_arena,
      &other->body_, rhs_arena
  );
  swap(header_, other->header_);
}

std::string HeaderAndBody::GetTypeName() const {
  return "securemessage.HeaderAndBody";
}


// ===================================================================

class HeaderAndBodyInternal::_Internal {
 public:
  using HasBits = decltype(std::declval<HeaderAndBodyInternal>()._has_bits_);
  static void set_has_header(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_body(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
  }
};

HeaderAndBodyInternal::HeaderAndBodyInternal(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.HeaderAndBodyInternal)
}
HeaderAndBodyInternal::HeaderAndBodyInternal(const HeaderAndBodyInternal& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    header_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_header()) {
    header_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_header(), 
      GetArenaForAllocation());
  }
  body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_body()) {
    body_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_body(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:securemessage.HeaderAndBodyInternal)
}

inline void HeaderAndBodyInternal::SharedCtor() {
header_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  header_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
body_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  body_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

HeaderAndBodyInternal::~HeaderAndBodyInternal() {
  // @@protoc_insertion_point(destructor:securemessage.HeaderAndBodyInternal)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void HeaderAndBodyInternal::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  header_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  body_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void HeaderAndBodyInternal::ArenaDtor(void* object) {
  HeaderAndBodyInternal* _this = reinterpret_cast< HeaderAndBodyInternal* >(object);
  (void)_this;
}
void HeaderAndBodyInternal::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void HeaderAndBodyInternal::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void HeaderAndBodyInternal::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.HeaderAndBodyInternal)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      header_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      body_.ClearNonDefaultToEmpty();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* HeaderAndBodyInternal::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required bytes header = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_header();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // required bytes body = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_body();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* HeaderAndBodyInternal::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.HeaderAndBodyInternal)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required bytes header = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_header(), target);
  }

  // required bytes body = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_body(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.HeaderAndBodyInternal)
  return target;
}

size_t HeaderAndBodyInternal::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:securemessage.HeaderAndBodyInternal)
  size_t total_size = 0;

  if (_internal_has_header()) {
    // required bytes header = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_header());
  }

  if (_internal_has_body()) {
    // required bytes body = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_body());
  }

  return total_size;
}
size_t HeaderAndBodyInternal::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.HeaderAndBodyInternal)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required bytes header = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_header());

    // required bytes body = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_body());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void HeaderAndBodyInternal::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const HeaderAndBodyInternal*>(
      &from));
}

void HeaderAndBodyInternal::MergeFrom(const HeaderAndBodyInternal& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.HeaderAndBodyInternal)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_header(from._internal_header());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_body(from._internal_body());
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void HeaderAndBodyInternal::CopyFrom(const HeaderAndBodyInternal& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.HeaderAndBodyInternal)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool HeaderAndBodyInternal::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void HeaderAndBodyInternal::InternalSwap(HeaderAndBodyInternal* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &header_, lhs_arena,
      &other->header_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &body_, lhs_arena,
      &other->body_, rhs_arena
  );
}

std::string HeaderAndBodyInternal::GetTypeName() const {
  return "securemessage.HeaderAndBodyInternal";
}


// ===================================================================

class EcP256PublicKey::_Internal {
 public:
  using HasBits = decltype(std::declval<EcP256PublicKey>()._has_bits_);
  static void set_has_x(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_y(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000003) ^ 0x00000003) != 0;
  }
};

EcP256PublicKey::EcP256PublicKey(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.EcP256PublicKey)
}
EcP256PublicKey::EcP256PublicKey(const EcP256PublicKey& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  x_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    x_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_x()) {
    x_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_x(), 
      GetArenaForAllocation());
  }
  y_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    y_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_y()) {
    y_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_y(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:securemessage.EcP256PublicKey)
}

inline void EcP256PublicKey::SharedCtor() {
x_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  x_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
y_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  y_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

EcP256PublicKey::~EcP256PublicKey() {
  // @@protoc_insertion_point(destructor:securemessage.EcP256PublicKey)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void EcP256PublicKey::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  x_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  y_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void EcP256PublicKey::ArenaDtor(void* object) {
  EcP256PublicKey* _this = reinterpret_cast< EcP256PublicKey* >(object);
  (void)_this;
}
void EcP256PublicKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void EcP256PublicKey::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void EcP256PublicKey::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.EcP256PublicKey)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      x_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      y_.ClearNonDefaultToEmpty();
    }
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* EcP256PublicKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required bytes x = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_x();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // required bytes y = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_y();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* EcP256PublicKey::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.EcP256PublicKey)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required bytes x = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_x(), target);
  }

  // required bytes y = 2;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteBytesMaybeAliased(
        2, this->_internal_y(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.EcP256PublicKey)
  return target;
}

size_t EcP256PublicKey::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:securemessage.EcP256PublicKey)
  size_t total_size = 0;

  if (_internal_has_x()) {
    // required bytes x = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_x());
  }

  if (_internal_has_y()) {
    // required bytes y = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_y());
  }

  return total_size;
}
size_t EcP256PublicKey::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.EcP256PublicKey)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required bytes x = 1;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_x());

    // required bytes y = 2;
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_y());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void EcP256PublicKey::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const EcP256PublicKey*>(
      &from));
}

void EcP256PublicKey::MergeFrom(const EcP256PublicKey& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.EcP256PublicKey)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_x(from._internal_x());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_y(from._internal_y());
    }
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void EcP256PublicKey::CopyFrom(const EcP256PublicKey& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.EcP256PublicKey)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool EcP256PublicKey::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void EcP256PublicKey::InternalSwap(EcP256PublicKey* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &x_, lhs_arena,
      &other->x_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &y_, lhs_arena,
      &other->y_, rhs_arena
  );
}

std::string EcP256PublicKey::GetTypeName() const {
  return "securemessage.EcP256PublicKey";
}


// ===================================================================

class SimpleRsaPublicKey::_Internal {
 public:
  using HasBits = decltype(std::declval<SimpleRsaPublicKey>()._has_bits_);
  static void set_has_n(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_e(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

SimpleRsaPublicKey::SimpleRsaPublicKey(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.SimpleRsaPublicKey)
}
SimpleRsaPublicKey::SimpleRsaPublicKey(const SimpleRsaPublicKey& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  n_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    n_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_n()) {
    n_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_n(), 
      GetArenaForAllocation());
  }
  e_ = from.e_;
  // @@protoc_insertion_point(copy_constructor:securemessage.SimpleRsaPublicKey)
}

inline void SimpleRsaPublicKey::SharedCtor() {
n_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  n_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
e_ = 65537;
}

SimpleRsaPublicKey::~SimpleRsaPublicKey() {
  // @@protoc_insertion_point(destructor:securemessage.SimpleRsaPublicKey)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void SimpleRsaPublicKey::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  n_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void SimpleRsaPublicKey::ArenaDtor(void* object) {
  SimpleRsaPublicKey* _this = reinterpret_cast< SimpleRsaPublicKey* >(object);
  (void)_this;
}
void SimpleRsaPublicKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void SimpleRsaPublicKey::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void SimpleRsaPublicKey::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.SimpleRsaPublicKey)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      n_.ClearNonDefaultToEmpty();
    }
    e_ = 65537;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* SimpleRsaPublicKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required bytes n = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_n();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 e = 2 [default = 65537];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_e(&has_bits);
          e_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* SimpleRsaPublicKey::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.SimpleRsaPublicKey)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required bytes n = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_n(), target);
  }

  // optional int32 e = 2 [default = 65537];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_e(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.SimpleRsaPublicKey)
  return target;
}

size_t SimpleRsaPublicKey::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.SimpleRsaPublicKey)
  size_t total_size = 0;

  // required bytes n = 1;
  if (_internal_has_n()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_n());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // optional int32 e = 2 [default = 65537];
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000002u) {
    total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_e());
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void SimpleRsaPublicKey::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const SimpleRsaPublicKey*>(
      &from));
}

void SimpleRsaPublicKey::MergeFrom(const SimpleRsaPublicKey& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.SimpleRsaPublicKey)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_n(from._internal_n());
    }
    if (cached_has_bits & 0x00000002u) {
      e_ = from.e_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void SimpleRsaPublicKey::CopyFrom(const SimpleRsaPublicKey& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.SimpleRsaPublicKey)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SimpleRsaPublicKey::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void SimpleRsaPublicKey::InternalSwap(SimpleRsaPublicKey* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &n_, lhs_arena,
      &other->n_, rhs_arena
  );
  swap(e_, other->e_);
}

std::string SimpleRsaPublicKey::GetTypeName() const {
  return "securemessage.SimpleRsaPublicKey";
}


// ===================================================================

class DhPublicKey::_Internal {
 public:
  using HasBits = decltype(std::declval<DhPublicKey>()._has_bits_);
  static void set_has_y(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000001) ^ 0x00000001) != 0;
  }
};

DhPublicKey::DhPublicKey(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.DhPublicKey)
}
DhPublicKey::DhPublicKey(const DhPublicKey& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  y_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    y_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_y()) {
    y_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_y(), 
      GetArenaForAllocation());
  }
  // @@protoc_insertion_point(copy_constructor:securemessage.DhPublicKey)
}

inline void DhPublicKey::SharedCtor() {
y_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  y_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

DhPublicKey::~DhPublicKey() {
  // @@protoc_insertion_point(destructor:securemessage.DhPublicKey)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void DhPublicKey::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  y_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void DhPublicKey::ArenaDtor(void* object) {
  DhPublicKey* _this = reinterpret_cast< DhPublicKey* >(object);
  (void)_this;
}
void DhPublicKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void DhPublicKey::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void DhPublicKey::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.DhPublicKey)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    y_.ClearNonDefaultToEmpty();
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* DhPublicKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required bytes y = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_y();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* DhPublicKey::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.DhPublicKey)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required bytes y = 1;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteBytesMaybeAliased(
        1, this->_internal_y(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.DhPublicKey)
  return target;
}

size_t DhPublicKey::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.DhPublicKey)
  size_t total_size = 0;

  // required bytes y = 1;
  if (_internal_has_y()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
        this->_internal_y());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void DhPublicKey::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const DhPublicKey*>(
      &from));
}

void DhPublicKey::MergeFrom(const DhPublicKey& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.DhPublicKey)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  if (from._internal_has_y()) {
    _internal_set_y(from._internal_y());
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void DhPublicKey::CopyFrom(const DhPublicKey& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.DhPublicKey)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DhPublicKey::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void DhPublicKey::InternalSwap(DhPublicKey* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &y_, lhs_arena,
      &other->y_, rhs_arena
  );
}

std::string DhPublicKey::GetTypeName() const {
  return "securemessage.DhPublicKey";
}


// ===================================================================

class GenericPublicKey::_Internal {
 public:
  using HasBits = decltype(std::declval<GenericPublicKey>()._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::securemessage::EcP256PublicKey& ec_p256_public_key(const GenericPublicKey* msg);
  static void set_has_ec_p256_public_key(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::securemessage::SimpleRsaPublicKey& rsa2048_public_key(const GenericPublicKey* msg);
  static void set_has_rsa2048_public_key(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::securemessage::DhPublicKey& dh2048_public_key(const GenericPublicKey* msg);
  static void set_has_dh2048_public_key(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000008) ^ 0x00000008) != 0;
  }
};

const ::securemessage::EcP256PublicKey&
GenericPublicKey::_Internal::ec_p256_public_key(const GenericPublicKey* msg) {
  return *msg->ec_p256_public_key_;
}
const ::securemessage::SimpleRsaPublicKey&
GenericPublicKey::_Internal::rsa2048_public_key(const GenericPublicKey* msg) {
  return *msg->rsa2048_public_key_;
}
const ::securemessage::DhPublicKey&
GenericPublicKey::_Internal::dh2048_public_key(const GenericPublicKey* msg) {
  return *msg->dh2048_public_key_;
}
GenericPublicKey::GenericPublicKey(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:securemessage.GenericPublicKey)
}
GenericPublicKey::GenericPublicKey(const GenericPublicKey& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  if (from._internal_has_ec_p256_public_key()) {
    ec_p256_public_key_ = new ::securemessage::EcP256PublicKey(*from.ec_p256_public_key_);
  } else {
    ec_p256_public_key_ = nullptr;
  }
  if (from._internal_has_rsa2048_public_key()) {
    rsa2048_public_key_ = new ::securemessage::SimpleRsaPublicKey(*from.rsa2048_public_key_);
  } else {
    rsa2048_public_key_ = nullptr;
  }
  if (from._internal_has_dh2048_public_key()) {
    dh2048_public_key_ = new ::securemessage::DhPublicKey(*from.dh2048_public_key_);
  } else {
    dh2048_public_key_ = nullptr;
  }
  type_ = from.type_;
  // @@protoc_insertion_point(copy_constructor:securemessage.GenericPublicKey)
}

inline void GenericPublicKey::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&ec_p256_public_key_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&dh2048_public_key_) -
    reinterpret_cast<char*>(&ec_p256_public_key_)) + sizeof(dh2048_public_key_));
type_ = 1;
}

GenericPublicKey::~GenericPublicKey() {
  // @@protoc_insertion_point(destructor:securemessage.GenericPublicKey)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<std::string>();
}

inline void GenericPublicKey::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete ec_p256_public_key_;
  if (this != internal_default_instance()) delete rsa2048_public_key_;
  if (this != internal_default_instance()) delete dh2048_public_key_;
}

void GenericPublicKey::ArenaDtor(void* object) {
  GenericPublicKey* _this = reinterpret_cast< GenericPublicKey* >(object);
  (void)_this;
}
void GenericPublicKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void GenericPublicKey::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void GenericPublicKey::Clear() {
// @@protoc_insertion_point(message_clear_start:securemessage.GenericPublicKey)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(ec_p256_public_key_ != nullptr);
      ec_p256_public_key_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(rsa2048_public_key_ != nullptr);
      rsa2048_public_key_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(dh2048_public_key_ != nullptr);
      dh2048_public_key_->Clear();
    }
    type_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* GenericPublicKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required .securemessage.PublicKeyType type = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::securemessage::PublicKeyType_IsValid(val))) {
            _internal_set_type(static_cast<::securemessage::PublicKeyType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional .securemessage.EcP256PublicKey ec_p256_public_key = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_ec_p256_public_key(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .securemessage.SimpleRsaPublicKey rsa2048_public_key = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_rsa2048_public_key(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .securemessage.DhPublicKey dh2048_public_key = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_dh2048_public_key(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* GenericPublicKey::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:securemessage.GenericPublicKey)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required .securemessage.PublicKeyType type = 1;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
      1, this->_internal_type(), target);
  }

  // optional .securemessage.EcP256PublicKey ec_p256_public_key = 2;
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        2, _Internal::ec_p256_public_key(this), target, stream);
  }

  // optional .securemessage.SimpleRsaPublicKey rsa2048_public_key = 3;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        3, _Internal::rsa2048_public_key(this), target, stream);
  }

  // optional .securemessage.DhPublicKey dh2048_public_key = 4;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        4, _Internal::dh2048_public_key(this), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:securemessage.GenericPublicKey)
  return target;
}

size_t GenericPublicKey::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:securemessage.GenericPublicKey)
  size_t total_size = 0;

  // required .securemessage.PublicKeyType type = 1;
  if (_internal_has_type()) {
    total_size += 1 +
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type());
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional .securemessage.EcP256PublicKey ec_p256_public_key = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *ec_p256_public_key_);
    }

    // optional .securemessage.SimpleRsaPublicKey rsa2048_public_key = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *rsa2048_public_key_);
    }

    // optional .securemessage.DhPublicKey dh2048_public_key = 4;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *dh2048_public_key_);
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void GenericPublicKey::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::PROTOBUF_NAMESPACE_ID::internal::DownCast<const GenericPublicKey*>(
      &from));
}

void GenericPublicKey::MergeFrom(const GenericPublicKey& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:securemessage.GenericPublicKey)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_mutable_ec_p256_public_key()->::securemessage::EcP256PublicKey::MergeFrom(from._internal_ec_p256_public_key());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_rsa2048_public_key()->::securemessage::SimpleRsaPublicKey::MergeFrom(from._internal_rsa2048_public_key());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_mutable_dh2048_public_key()->::securemessage::DhPublicKey::MergeFrom(from._internal_dh2048_public_key());
    }
    if (cached_has_bits & 0x00000008u) {
      type_ = from.type_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void GenericPublicKey::CopyFrom(const GenericPublicKey& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:securemessage.GenericPublicKey)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool GenericPublicKey::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  if (_internal_has_ec_p256_public_key()) {
    if (!ec_p256_public_key_->IsInitialized()) return false;
  }
  if (_internal_has_rsa2048_public_key()) {
    if (!rsa2048_public_key_->IsInitialized()) return false;
  }
  if (_internal_has_dh2048_public_key()) {
    if (!dh2048_public_key_->IsInitialized()) return false;
  }
  return true;
}

void GenericPublicKey::InternalSwap(GenericPublicKey* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(GenericPublicKey, dh2048_public_key_)
      + sizeof(GenericPublicKey::dh2048_public_key_)
      - PROTOBUF_FIELD_OFFSET(GenericPublicKey, ec_p256_public_key_)>(
          reinterpret_cast<char*>(&ec_p256_public_key_),
          reinterpret_cast<char*>(&other->ec_p256_public_key_));
  swap(type_, other->type_);
}

std::string GenericPublicKey::GetTypeName() const {
  return "securemessage.GenericPublicKey";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace securemessage
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::securemessage::SecureMessage* Arena::CreateMaybeMessage< ::securemessage::SecureMessage >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::SecureMessage >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::Header* Arena::CreateMaybeMessage< ::securemessage::Header >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::Header >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::HeaderAndBody* Arena::CreateMaybeMessage< ::securemessage::HeaderAndBody >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::HeaderAndBody >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::HeaderAndBodyInternal* Arena::CreateMaybeMessage< ::securemessage::HeaderAndBodyInternal >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::HeaderAndBodyInternal >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::EcP256PublicKey* Arena::CreateMaybeMessage< ::securemessage::EcP256PublicKey >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::EcP256PublicKey >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::SimpleRsaPublicKey* Arena::CreateMaybeMessage< ::securemessage::SimpleRsaPublicKey >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::SimpleRsaPublicKey >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::DhPublicKey* Arena::CreateMaybeMessage< ::securemessage::DhPublicKey >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::DhPublicKey >(arena);
}
template<> PROTOBUF_NOINLINE ::securemessage::GenericPublicKey* Arena::CreateMaybeMessage< ::securemessage::GenericPublicKey >(Arena* arena) {
  return Arena::CreateMessageInternal< ::securemessage::GenericPublicKey >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
