620 lines
24 KiB
C++
Executable File
620 lines
24 KiB
C++
Executable File
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
// source: encrypted_message.proto
|
|
|
|
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
|
|
#include "encrypted_message.pb.h"
|
|
|
|
#include <algorithm>
|
|
|
|
#include <google/protobuf/stubs/common.h>
|
|
#include <google/protobuf/stubs/port.h>
|
|
#include <google/protobuf/stubs/once.h>
|
|
#include <google/protobuf/io/coded_stream.h>
|
|
#include <google/protobuf/wire_format_lite_inl.h>
|
|
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
|
|
// @@protoc_insertion_point(includes)
|
|
|
|
namespace encrypted_messages {
|
|
class EncryptedMessageDefaultTypeInternal : public ::google::protobuf::internal::ExplicitlyConstructed<EncryptedMessage> {
|
|
} _EncryptedMessage_default_instance_;
|
|
|
|
namespace protobuf_encrypted_5fmessage_2eproto {
|
|
|
|
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTableField
|
|
const TableStruct::entries[] = {
|
|
{0, 0, 0, ::google::protobuf::internal::kInvalidMask, 0, 0},
|
|
};
|
|
|
|
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::AuxillaryParseTableField
|
|
const TableStruct::aux[] = {
|
|
::google::protobuf::internal::AuxillaryParseTableField(),
|
|
};
|
|
PROTOBUF_CONSTEXPR_VAR ::google::protobuf::internal::ParseTable const
|
|
TableStruct::schema[] = {
|
|
{ NULL, NULL, 0, -1, -1, false },
|
|
};
|
|
|
|
|
|
void TableStruct::Shutdown() {
|
|
_EncryptedMessage_default_instance_.Shutdown();
|
|
}
|
|
|
|
void TableStruct::InitDefaultsImpl() {
|
|
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
|
|
|
::google::protobuf::internal::InitProtobufDefaults();
|
|
_EncryptedMessage_default_instance_.DefaultConstruct();
|
|
}
|
|
|
|
void InitDefaults() {
|
|
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
|
|
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
|
|
}
|
|
void AddDescriptorsImpl() {
|
|
InitDefaults();
|
|
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
|
|
}
|
|
|
|
void AddDescriptors() {
|
|
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
|
|
::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
|
|
}
|
|
|
|
} // namespace protobuf_encrypted_5fmessage_2eproto
|
|
|
|
bool EncryptedMessage_Algorithm_IsValid(int value) {
|
|
switch (value) {
|
|
case 0:
|
|
case 1:
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
#if !defined(_MSC_VER) || _MSC_VER >= 1900
|
|
const EncryptedMessage_Algorithm EncryptedMessage::UNKNOWN_ALGORITHM;
|
|
const EncryptedMessage_Algorithm EncryptedMessage::AEAD_ECDH_AES_128_CTR_HMAC_SHA256;
|
|
const EncryptedMessage_Algorithm EncryptedMessage::Algorithm_MIN;
|
|
const EncryptedMessage_Algorithm EncryptedMessage::Algorithm_MAX;
|
|
const int EncryptedMessage::Algorithm_ARRAYSIZE;
|
|
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
|
|
|
|
// ===================================================================
|
|
|
|
#if !defined(_MSC_VER) || _MSC_VER >= 1900
|
|
const int EncryptedMessage::kEncryptedMessageFieldNumber;
|
|
const int EncryptedMessage::kServerPublicKeyVersionFieldNumber;
|
|
const int EncryptedMessage::kClientPublicKeyFieldNumber;
|
|
const int EncryptedMessage::kAlgorithmFieldNumber;
|
|
#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
|
|
|
|
EncryptedMessage::EncryptedMessage()
|
|
: ::google::protobuf::MessageLite(), _internal_metadata_(NULL) {
|
|
if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
|
|
protobuf_encrypted_5fmessage_2eproto::InitDefaults();
|
|
}
|
|
SharedCtor();
|
|
// @@protoc_insertion_point(constructor:encrypted_messages.EncryptedMessage)
|
|
}
|
|
EncryptedMessage::EncryptedMessage(const EncryptedMessage& from)
|
|
: ::google::protobuf::MessageLite(),
|
|
_internal_metadata_(NULL),
|
|
_has_bits_(from._has_bits_),
|
|
_cached_size_(0) {
|
|
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
|
encrypted_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
if (from.has_encrypted_message()) {
|
|
encrypted_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encrypted_message_);
|
|
}
|
|
client_public_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
if (from.has_client_public_key()) {
|
|
client_public_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.client_public_key_);
|
|
}
|
|
::memcpy(&server_public_key_version_, &from.server_public_key_version_,
|
|
static_cast<size_t>(reinterpret_cast<char*>(&algorithm_) -
|
|
reinterpret_cast<char*>(&server_public_key_version_)) + sizeof(algorithm_));
|
|
// @@protoc_insertion_point(copy_constructor:encrypted_messages.EncryptedMessage)
|
|
}
|
|
|
|
void EncryptedMessage::SharedCtor() {
|
|
_cached_size_ = 0;
|
|
encrypted_message_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
client_public_key_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
server_public_key_version_ = 0u;
|
|
algorithm_ = 1;
|
|
}
|
|
|
|
EncryptedMessage::~EncryptedMessage() {
|
|
// @@protoc_insertion_point(destructor:encrypted_messages.EncryptedMessage)
|
|
SharedDtor();
|
|
}
|
|
|
|
void EncryptedMessage::SharedDtor() {
|
|
encrypted_message_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
client_public_key_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
}
|
|
|
|
void EncryptedMessage::SetCachedSize(int size) const {
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
|
_cached_size_ = size;
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
|
}
|
|
const EncryptedMessage& EncryptedMessage::default_instance() {
|
|
protobuf_encrypted_5fmessage_2eproto::InitDefaults();
|
|
return *internal_default_instance();
|
|
}
|
|
|
|
EncryptedMessage* EncryptedMessage::New(::google::protobuf::Arena* arena) const {
|
|
EncryptedMessage* n = new EncryptedMessage;
|
|
if (arena != NULL) {
|
|
arena->Own(n);
|
|
}
|
|
return n;
|
|
}
|
|
|
|
void EncryptedMessage::Clear() {
|
|
// @@protoc_insertion_point(message_clear_start:encrypted_messages.EncryptedMessage)
|
|
if (_has_bits_[0 / 32] & 3u) {
|
|
if (has_encrypted_message()) {
|
|
GOOGLE_DCHECK(!encrypted_message_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
|
|
(*encrypted_message_.UnsafeRawStringPointer())->clear();
|
|
}
|
|
if (has_client_public_key()) {
|
|
GOOGLE_DCHECK(!client_public_key_.IsDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()));
|
|
(*client_public_key_.UnsafeRawStringPointer())->clear();
|
|
}
|
|
}
|
|
if (_has_bits_[0 / 32] & 12u) {
|
|
server_public_key_version_ = 0u;
|
|
algorithm_ = 1;
|
|
}
|
|
_has_bits_.Clear();
|
|
_internal_metadata_.Clear();
|
|
}
|
|
|
|
bool EncryptedMessage::MergePartialFromCodedStream(
|
|
::google::protobuf::io::CodedInputStream* input) {
|
|
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
|
|
::google::protobuf::uint32 tag;
|
|
::google::protobuf::io::LazyStringOutputStream unknown_fields_string(
|
|
::google::protobuf::NewPermanentCallback(&_internal_metadata_,
|
|
&::google::protobuf::internal::InternalMetadataWithArenaLite::
|
|
mutable_unknown_fields));
|
|
::google::protobuf::io::CodedOutputStream unknown_fields_stream(
|
|
&unknown_fields_string, false);
|
|
// @@protoc_insertion_point(parse_start:encrypted_messages.EncryptedMessage)
|
|
for (;;) {
|
|
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
|
|
tag = p.first;
|
|
if (!p.second) goto handle_unusual;
|
|
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
|
|
// required bytes encrypted_message = 1;
|
|
case 1: {
|
|
if (static_cast< ::google::protobuf::uint8>(tag) ==
|
|
static_cast< ::google::protobuf::uint8>(10u)) {
|
|
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
|
input, this->mutable_encrypted_message()));
|
|
} else {
|
|
goto handle_unusual;
|
|
}
|
|
break;
|
|
}
|
|
|
|
// required uint32 server_public_key_version = 2;
|
|
case 2: {
|
|
if (static_cast< ::google::protobuf::uint8>(tag) ==
|
|
static_cast< ::google::protobuf::uint8>(16u)) {
|
|
set_has_server_public_key_version();
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
|
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
|
|
input, &server_public_key_version_)));
|
|
} else {
|
|
goto handle_unusual;
|
|
}
|
|
break;
|
|
}
|
|
|
|
// required bytes client_public_key = 3;
|
|
case 3: {
|
|
if (static_cast< ::google::protobuf::uint8>(tag) ==
|
|
static_cast< ::google::protobuf::uint8>(26u)) {
|
|
DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
|
|
input, this->mutable_client_public_key()));
|
|
} else {
|
|
goto handle_unusual;
|
|
}
|
|
break;
|
|
}
|
|
|
|
// optional .encrypted_messages.EncryptedMessage.Algorithm algorithm = 4 [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256];
|
|
case 4: {
|
|
if (static_cast< ::google::protobuf::uint8>(tag) ==
|
|
static_cast< ::google::protobuf::uint8>(32u)) {
|
|
int value;
|
|
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
|
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
|
|
input, &value)));
|
|
if (::encrypted_messages::EncryptedMessage_Algorithm_IsValid(value)) {
|
|
set_algorithm(static_cast< ::encrypted_messages::EncryptedMessage_Algorithm >(value));
|
|
} else {
|
|
unknown_fields_stream.WriteVarint32(32u);
|
|
unknown_fields_stream.WriteVarint32(
|
|
static_cast< ::google::protobuf::uint32>(value));
|
|
}
|
|
} else {
|
|
goto handle_unusual;
|
|
}
|
|
break;
|
|
}
|
|
|
|
default: {
|
|
handle_unusual:
|
|
if (tag == 0 ||
|
|
::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
|
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
|
|
goto success;
|
|
}
|
|
DO_(::google::protobuf::internal::WireFormatLite::SkipField(
|
|
input, tag, &unknown_fields_stream));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
success:
|
|
// @@protoc_insertion_point(parse_success:encrypted_messages.EncryptedMessage)
|
|
return true;
|
|
failure:
|
|
// @@protoc_insertion_point(parse_failure:encrypted_messages.EncryptedMessage)
|
|
return false;
|
|
#undef DO_
|
|
}
|
|
|
|
void EncryptedMessage::SerializeWithCachedSizes(
|
|
::google::protobuf::io::CodedOutputStream* output) const {
|
|
// @@protoc_insertion_point(serialize_start:encrypted_messages.EncryptedMessage)
|
|
::google::protobuf::uint32 cached_has_bits = 0;
|
|
(void) cached_has_bits;
|
|
|
|
cached_has_bits = _has_bits_[0];
|
|
// required bytes encrypted_message = 1;
|
|
if (cached_has_bits & 0x00000001u) {
|
|
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
|
|
1, this->encrypted_message(), output);
|
|
}
|
|
|
|
// required uint32 server_public_key_version = 2;
|
|
if (cached_has_bits & 0x00000004u) {
|
|
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->server_public_key_version(), output);
|
|
}
|
|
|
|
// required bytes client_public_key = 3;
|
|
if (cached_has_bits & 0x00000002u) {
|
|
::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
|
|
3, this->client_public_key(), output);
|
|
}
|
|
|
|
// optional .encrypted_messages.EncryptedMessage.Algorithm algorithm = 4 [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256];
|
|
if (cached_has_bits & 0x00000008u) {
|
|
::google::protobuf::internal::WireFormatLite::WriteEnum(
|
|
4, this->algorithm(), output);
|
|
}
|
|
|
|
output->WriteRaw(unknown_fields().data(),
|
|
static_cast<int>(unknown_fields().size()));
|
|
// @@protoc_insertion_point(serialize_end:encrypted_messages.EncryptedMessage)
|
|
}
|
|
|
|
size_t EncryptedMessage::RequiredFieldsByteSizeFallback() const {
|
|
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:encrypted_messages.EncryptedMessage)
|
|
size_t total_size = 0;
|
|
|
|
if (has_encrypted_message()) {
|
|
// required bytes encrypted_message = 1;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::BytesSize(
|
|
this->encrypted_message());
|
|
}
|
|
|
|
if (has_client_public_key()) {
|
|
// required bytes client_public_key = 3;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::BytesSize(
|
|
this->client_public_key());
|
|
}
|
|
|
|
if (has_server_public_key_version()) {
|
|
// required uint32 server_public_key_version = 2;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
|
this->server_public_key_version());
|
|
}
|
|
|
|
return total_size;
|
|
}
|
|
size_t EncryptedMessage::ByteSizeLong() const {
|
|
// @@protoc_insertion_point(message_byte_size_start:encrypted_messages.EncryptedMessage)
|
|
size_t total_size = 0;
|
|
|
|
total_size += unknown_fields().size();
|
|
|
|
if (((_has_bits_[0] & 0x00000007) ^ 0x00000007) == 0) { // All required fields are present.
|
|
// required bytes encrypted_message = 1;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::BytesSize(
|
|
this->encrypted_message());
|
|
|
|
// required bytes client_public_key = 3;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::BytesSize(
|
|
this->client_public_key());
|
|
|
|
// required uint32 server_public_key_version = 2;
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
|
this->server_public_key_version());
|
|
|
|
} else {
|
|
total_size += RequiredFieldsByteSizeFallback();
|
|
}
|
|
// optional .encrypted_messages.EncryptedMessage.Algorithm algorithm = 4 [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256];
|
|
if (has_algorithm()) {
|
|
total_size += 1 +
|
|
::google::protobuf::internal::WireFormatLite::EnumSize(this->algorithm());
|
|
}
|
|
|
|
int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
|
|
_cached_size_ = cached_size;
|
|
GOOGLE_SAFE_CONCURRENT_WRITES_END();
|
|
return total_size;
|
|
}
|
|
|
|
void EncryptedMessage::CheckTypeAndMergeFrom(
|
|
const ::google::protobuf::MessageLite& from) {
|
|
MergeFrom(*::google::protobuf::down_cast<const EncryptedMessage*>(&from));
|
|
}
|
|
|
|
void EncryptedMessage::MergeFrom(const EncryptedMessage& from) {
|
|
// @@protoc_insertion_point(class_specific_merge_from_start:encrypted_messages.EncryptedMessage)
|
|
GOOGLE_DCHECK_NE(&from, this);
|
|
_internal_metadata_.MergeFrom(from._internal_metadata_);
|
|
::google::protobuf::uint32 cached_has_bits = 0;
|
|
(void) cached_has_bits;
|
|
|
|
cached_has_bits = from._has_bits_[0];
|
|
if (cached_has_bits & 15u) {
|
|
if (cached_has_bits & 0x00000001u) {
|
|
set_has_encrypted_message();
|
|
encrypted_message_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.encrypted_message_);
|
|
}
|
|
if (cached_has_bits & 0x00000002u) {
|
|
set_has_client_public_key();
|
|
client_public_key_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.client_public_key_);
|
|
}
|
|
if (cached_has_bits & 0x00000004u) {
|
|
server_public_key_version_ = from.server_public_key_version_;
|
|
}
|
|
if (cached_has_bits & 0x00000008u) {
|
|
algorithm_ = from.algorithm_;
|
|
}
|
|
_has_bits_[0] |= cached_has_bits;
|
|
}
|
|
}
|
|
|
|
void EncryptedMessage::CopyFrom(const EncryptedMessage& from) {
|
|
// @@protoc_insertion_point(class_specific_copy_from_start:encrypted_messages.EncryptedMessage)
|
|
if (&from == this) return;
|
|
Clear();
|
|
MergeFrom(from);
|
|
}
|
|
|
|
bool EncryptedMessage::IsInitialized() const {
|
|
if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
|
|
return true;
|
|
}
|
|
|
|
void EncryptedMessage::Swap(EncryptedMessage* other) {
|
|
if (other == this) return;
|
|
InternalSwap(other);
|
|
}
|
|
void EncryptedMessage::InternalSwap(EncryptedMessage* other) {
|
|
encrypted_message_.Swap(&other->encrypted_message_);
|
|
client_public_key_.Swap(&other->client_public_key_);
|
|
std::swap(server_public_key_version_, other->server_public_key_version_);
|
|
std::swap(algorithm_, other->algorithm_);
|
|
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
|
_internal_metadata_.Swap(&other->_internal_metadata_);
|
|
std::swap(_cached_size_, other->_cached_size_);
|
|
}
|
|
|
|
::std::string EncryptedMessage::GetTypeName() const {
|
|
return "encrypted_messages.EncryptedMessage";
|
|
}
|
|
|
|
#if PROTOBUF_INLINE_NOT_IN_HEADERS
|
|
// EncryptedMessage
|
|
|
|
// required bytes encrypted_message = 1;
|
|
bool EncryptedMessage::has_encrypted_message() const {
|
|
return (_has_bits_[0] & 0x00000001u) != 0;
|
|
}
|
|
void EncryptedMessage::set_has_encrypted_message() {
|
|
_has_bits_[0] |= 0x00000001u;
|
|
}
|
|
void EncryptedMessage::clear_has_encrypted_message() {
|
|
_has_bits_[0] &= ~0x00000001u;
|
|
}
|
|
void EncryptedMessage::clear_encrypted_message() {
|
|
encrypted_message_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
clear_has_encrypted_message();
|
|
}
|
|
const ::std::string& EncryptedMessage::encrypted_message() const {
|
|
// @@protoc_insertion_point(field_get:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
return encrypted_message_.GetNoArena();
|
|
}
|
|
void EncryptedMessage::set_encrypted_message(const ::std::string& value) {
|
|
set_has_encrypted_message();
|
|
encrypted_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
|
|
// @@protoc_insertion_point(field_set:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
}
|
|
#if LANG_CXX11
|
|
void EncryptedMessage::set_encrypted_message(::std::string&& value) {
|
|
set_has_encrypted_message();
|
|
encrypted_message_.SetNoArena(
|
|
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
|
// @@protoc_insertion_point(field_set_rvalue:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
}
|
|
#endif
|
|
void EncryptedMessage::set_encrypted_message(const char* value) {
|
|
GOOGLE_DCHECK(value != NULL);
|
|
set_has_encrypted_message();
|
|
encrypted_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
|
// @@protoc_insertion_point(field_set_char:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
}
|
|
void EncryptedMessage::set_encrypted_message(const void* value, size_t size) {
|
|
set_has_encrypted_message();
|
|
encrypted_message_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
|
::std::string(reinterpret_cast<const char*>(value), size));
|
|
// @@protoc_insertion_point(field_set_pointer:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
}
|
|
::std::string* EncryptedMessage::mutable_encrypted_message() {
|
|
set_has_encrypted_message();
|
|
// @@protoc_insertion_point(field_mutable:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
return encrypted_message_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
}
|
|
::std::string* EncryptedMessage::release_encrypted_message() {
|
|
// @@protoc_insertion_point(field_release:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
clear_has_encrypted_message();
|
|
return encrypted_message_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
}
|
|
void EncryptedMessage::set_allocated_encrypted_message(::std::string* encrypted_message) {
|
|
if (encrypted_message != NULL) {
|
|
set_has_encrypted_message();
|
|
} else {
|
|
clear_has_encrypted_message();
|
|
}
|
|
encrypted_message_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), encrypted_message);
|
|
// @@protoc_insertion_point(field_set_allocated:encrypted_messages.EncryptedMessage.encrypted_message)
|
|
}
|
|
|
|
// required uint32 server_public_key_version = 2;
|
|
bool EncryptedMessage::has_server_public_key_version() const {
|
|
return (_has_bits_[0] & 0x00000004u) != 0;
|
|
}
|
|
void EncryptedMessage::set_has_server_public_key_version() {
|
|
_has_bits_[0] |= 0x00000004u;
|
|
}
|
|
void EncryptedMessage::clear_has_server_public_key_version() {
|
|
_has_bits_[0] &= ~0x00000004u;
|
|
}
|
|
void EncryptedMessage::clear_server_public_key_version() {
|
|
server_public_key_version_ = 0u;
|
|
clear_has_server_public_key_version();
|
|
}
|
|
::google::protobuf::uint32 EncryptedMessage::server_public_key_version() const {
|
|
// @@protoc_insertion_point(field_get:encrypted_messages.EncryptedMessage.server_public_key_version)
|
|
return server_public_key_version_;
|
|
}
|
|
void EncryptedMessage::set_server_public_key_version(::google::protobuf::uint32 value) {
|
|
set_has_server_public_key_version();
|
|
server_public_key_version_ = value;
|
|
// @@protoc_insertion_point(field_set:encrypted_messages.EncryptedMessage.server_public_key_version)
|
|
}
|
|
|
|
// required bytes client_public_key = 3;
|
|
bool EncryptedMessage::has_client_public_key() const {
|
|
return (_has_bits_[0] & 0x00000002u) != 0;
|
|
}
|
|
void EncryptedMessage::set_has_client_public_key() {
|
|
_has_bits_[0] |= 0x00000002u;
|
|
}
|
|
void EncryptedMessage::clear_has_client_public_key() {
|
|
_has_bits_[0] &= ~0x00000002u;
|
|
}
|
|
void EncryptedMessage::clear_client_public_key() {
|
|
client_public_key_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
clear_has_client_public_key();
|
|
}
|
|
const ::std::string& EncryptedMessage::client_public_key() const {
|
|
// @@protoc_insertion_point(field_get:encrypted_messages.EncryptedMessage.client_public_key)
|
|
return client_public_key_.GetNoArena();
|
|
}
|
|
void EncryptedMessage::set_client_public_key(const ::std::string& value) {
|
|
set_has_client_public_key();
|
|
client_public_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
|
|
// @@protoc_insertion_point(field_set:encrypted_messages.EncryptedMessage.client_public_key)
|
|
}
|
|
#if LANG_CXX11
|
|
void EncryptedMessage::set_client_public_key(::std::string&& value) {
|
|
set_has_client_public_key();
|
|
client_public_key_.SetNoArena(
|
|
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
|
|
// @@protoc_insertion_point(field_set_rvalue:encrypted_messages.EncryptedMessage.client_public_key)
|
|
}
|
|
#endif
|
|
void EncryptedMessage::set_client_public_key(const char* value) {
|
|
GOOGLE_DCHECK(value != NULL);
|
|
set_has_client_public_key();
|
|
client_public_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
|
|
// @@protoc_insertion_point(field_set_char:encrypted_messages.EncryptedMessage.client_public_key)
|
|
}
|
|
void EncryptedMessage::set_client_public_key(const void* value, size_t size) {
|
|
set_has_client_public_key();
|
|
client_public_key_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
|
|
::std::string(reinterpret_cast<const char*>(value), size));
|
|
// @@protoc_insertion_point(field_set_pointer:encrypted_messages.EncryptedMessage.client_public_key)
|
|
}
|
|
::std::string* EncryptedMessage::mutable_client_public_key() {
|
|
set_has_client_public_key();
|
|
// @@protoc_insertion_point(field_mutable:encrypted_messages.EncryptedMessage.client_public_key)
|
|
return client_public_key_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
}
|
|
::std::string* EncryptedMessage::release_client_public_key() {
|
|
// @@protoc_insertion_point(field_release:encrypted_messages.EncryptedMessage.client_public_key)
|
|
clear_has_client_public_key();
|
|
return client_public_key_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
|
|
}
|
|
void EncryptedMessage::set_allocated_client_public_key(::std::string* client_public_key) {
|
|
if (client_public_key != NULL) {
|
|
set_has_client_public_key();
|
|
} else {
|
|
clear_has_client_public_key();
|
|
}
|
|
client_public_key_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), client_public_key);
|
|
// @@protoc_insertion_point(field_set_allocated:encrypted_messages.EncryptedMessage.client_public_key)
|
|
}
|
|
|
|
// optional .encrypted_messages.EncryptedMessage.Algorithm algorithm = 4 [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256];
|
|
bool EncryptedMessage::has_algorithm() const {
|
|
return (_has_bits_[0] & 0x00000008u) != 0;
|
|
}
|
|
void EncryptedMessage::set_has_algorithm() {
|
|
_has_bits_[0] |= 0x00000008u;
|
|
}
|
|
void EncryptedMessage::clear_has_algorithm() {
|
|
_has_bits_[0] &= ~0x00000008u;
|
|
}
|
|
void EncryptedMessage::clear_algorithm() {
|
|
algorithm_ = 1;
|
|
clear_has_algorithm();
|
|
}
|
|
::encrypted_messages::EncryptedMessage_Algorithm EncryptedMessage::algorithm() const {
|
|
// @@protoc_insertion_point(field_get:encrypted_messages.EncryptedMessage.algorithm)
|
|
return static_cast< ::encrypted_messages::EncryptedMessage_Algorithm >(algorithm_);
|
|
}
|
|
void EncryptedMessage::set_algorithm(::encrypted_messages::EncryptedMessage_Algorithm value) {
|
|
assert(::encrypted_messages::EncryptedMessage_Algorithm_IsValid(value));
|
|
set_has_algorithm();
|
|
algorithm_ = value;
|
|
// @@protoc_insertion_point(field_set:encrypted_messages.EncryptedMessage.algorithm)
|
|
}
|
|
|
|
#endif // PROTOBUF_INLINE_NOT_IN_HEADERS
|
|
|
|
// @@protoc_insertion_point(namespace_scope)
|
|
|
|
} // namespace encrypted_messages
|
|
|
|
// @@protoc_insertion_point(global_scope)
|