1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: system/security/keystore/keystore_client.proto
3 
4 #include "system/security/keystore/keystore_client.pb.h"
5 
6 #include <algorithm>
7 #include <cstdint>
8 
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15 
16 PROTOBUF_PRAGMA_INIT_SEG
17 
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20 
21 namespace keystore {
EncryptedData(::_pbi::ConstantInitialized)22 PROTOBUF_CONSTEXPR EncryptedData::EncryptedData(
23     ::_pbi::ConstantInitialized): _impl_{
24     /*decltype(_impl_._has_bits_)*/{}
25   , /*decltype(_impl_._cached_size_)*/{}
26   , /*decltype(_impl_.init_vector_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
27   , /*decltype(_impl_.authentication_data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.encrypted_data_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
29 struct EncryptedDataDefaultTypeInternal {
EncryptedDataDefaultTypeInternalkeystore::EncryptedDataDefaultTypeInternal30   PROTOBUF_CONSTEXPR EncryptedDataDefaultTypeInternal()
31       : _instance(::_pbi::ConstantInitialized{}) {}
~EncryptedDataDefaultTypeInternalkeystore::EncryptedDataDefaultTypeInternal32   ~EncryptedDataDefaultTypeInternal() {}
33   union {  // NOLINT(misc-non-private-member-variables-in-classes)
34     EncryptedData _instance;
35   };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EncryptedDataDefaultTypeInternal _EncryptedData_default_instance_;
38 }  // namespace keystore
39 namespace keystore {
40 
41 // ===================================================================
42 
43 class EncryptedData::_Internal {
44  public:
45   using HasBits = decltype(std::declval<EncryptedData>()._impl_._has_bits_);
set_has_init_vector(HasBits * has_bits)46   static void set_has_init_vector(HasBits* has_bits) {
47     (*has_bits)[0] |= 1u;
48   }
set_has_authentication_data(HasBits * has_bits)49   static void set_has_authentication_data(HasBits* has_bits) {
50     (*has_bits)[0] |= 2u;
51   }
set_has_encrypted_data(HasBits * has_bits)52   static void set_has_encrypted_data(HasBits* has_bits) {
53     (*has_bits)[0] |= 4u;
54   }
55 };
56 
EncryptedData(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)57 EncryptedData::EncryptedData(::PROTOBUF_NAMESPACE_ID::Arena* arena,
58                          bool is_message_owned)
59   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
60   SharedCtor(arena, is_message_owned);
61   // @@protoc_insertion_point(arena_constructor:keystore.EncryptedData)
62 }
EncryptedData(const EncryptedData & from)63 EncryptedData::EncryptedData(const EncryptedData& from)
64   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
65   EncryptedData* const _this = this; (void)_this;
66   new (&_impl_) Impl_{
67       decltype(_impl_._has_bits_){from._impl_._has_bits_}
68     , /*decltype(_impl_._cached_size_)*/{}
69     , decltype(_impl_.init_vector_){}
70     , decltype(_impl_.authentication_data_){}
71     , decltype(_impl_.encrypted_data_){}};
72 
73   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
74   _impl_.init_vector_.InitDefault();
75   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
76     _impl_.init_vector_.Set("", GetArenaForAllocation());
77   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
78   if (from._internal_has_init_vector()) {
79     _this->_impl_.init_vector_.Set(from._internal_init_vector(),
80       _this->GetArenaForAllocation());
81   }
82   _impl_.authentication_data_.InitDefault();
83   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
84     _impl_.authentication_data_.Set("", GetArenaForAllocation());
85   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
86   if (from._internal_has_authentication_data()) {
87     _this->_impl_.authentication_data_.Set(from._internal_authentication_data(),
88       _this->GetArenaForAllocation());
89   }
90   _impl_.encrypted_data_.InitDefault();
91   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
92     _impl_.encrypted_data_.Set("", GetArenaForAllocation());
93   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
94   if (from._internal_has_encrypted_data()) {
95     _this->_impl_.encrypted_data_.Set(from._internal_encrypted_data(),
96       _this->GetArenaForAllocation());
97   }
98   // @@protoc_insertion_point(copy_constructor:keystore.EncryptedData)
99 }
100 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)101 inline void EncryptedData::SharedCtor(
102     ::_pb::Arena* arena, bool is_message_owned) {
103   (void)arena;
104   (void)is_message_owned;
105   new (&_impl_) Impl_{
106       decltype(_impl_._has_bits_){}
107     , /*decltype(_impl_._cached_size_)*/{}
108     , decltype(_impl_.init_vector_){}
109     , decltype(_impl_.authentication_data_){}
110     , decltype(_impl_.encrypted_data_){}
111   };
112   _impl_.init_vector_.InitDefault();
113   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
114     _impl_.init_vector_.Set("", GetArenaForAllocation());
115   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
116   _impl_.authentication_data_.InitDefault();
117   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
118     _impl_.authentication_data_.Set("", GetArenaForAllocation());
119   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
120   _impl_.encrypted_data_.InitDefault();
121   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
122     _impl_.encrypted_data_.Set("", GetArenaForAllocation());
123   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
124 }
125 
~EncryptedData()126 EncryptedData::~EncryptedData() {
127   // @@protoc_insertion_point(destructor:keystore.EncryptedData)
128   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
129   (void)arena;
130     return;
131   }
132   SharedDtor();
133 }
134 
SharedDtor()135 inline void EncryptedData::SharedDtor() {
136   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
137   _impl_.init_vector_.Destroy();
138   _impl_.authentication_data_.Destroy();
139   _impl_.encrypted_data_.Destroy();
140 }
141 
SetCachedSize(int size) const142 void EncryptedData::SetCachedSize(int size) const {
143   _impl_._cached_size_.Set(size);
144 }
145 
Clear()146 void EncryptedData::Clear() {
147 // @@protoc_insertion_point(message_clear_start:keystore.EncryptedData)
148   ::uint32_t cached_has_bits = 0;
149   // Prevent compiler warnings about cached_has_bits being unused
150   (void) cached_has_bits;
151 
152   cached_has_bits = _impl_._has_bits_[0];
153   if (cached_has_bits & 0x00000007u) {
154     if (cached_has_bits & 0x00000001u) {
155       _impl_.init_vector_.ClearNonDefaultToEmpty();
156     }
157     if (cached_has_bits & 0x00000002u) {
158       _impl_.authentication_data_.ClearNonDefaultToEmpty();
159     }
160     if (cached_has_bits & 0x00000004u) {
161       _impl_.encrypted_data_.ClearNonDefaultToEmpty();
162     }
163   }
164   _impl_._has_bits_.Clear();
165   _internal_metadata_.Clear<std::string>();
166 }
167 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)168 const char* EncryptedData::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
169 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
170   _Internal::HasBits has_bits{};
171   while (!ctx->Done(&ptr)) {
172     ::uint32_t tag;
173     ptr = ::_pbi::ReadTag(ptr, &tag);
174     switch (tag >> 3) {
175       // optional bytes init_vector = 1;
176       case 1:
177         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
178           auto str = _internal_mutable_init_vector();
179           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
180           CHK_(ptr);
181         } else {
182           goto handle_unusual;
183         }
184         continue;
185       // optional bytes authentication_data = 2;
186       case 2:
187         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
188           auto str = _internal_mutable_authentication_data();
189           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
190           CHK_(ptr);
191         } else {
192           goto handle_unusual;
193         }
194         continue;
195       // optional bytes encrypted_data = 3;
196       case 3:
197         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
198           auto str = _internal_mutable_encrypted_data();
199           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
200           CHK_(ptr);
201         } else {
202           goto handle_unusual;
203         }
204         continue;
205       default:
206         goto handle_unusual;
207     }  // switch
208   handle_unusual:
209     if ((tag == 0) || ((tag & 7) == 4)) {
210       CHK_(ptr);
211       ctx->SetLastTag(tag);
212       goto message_done;
213     }
214     ptr = UnknownFieldParse(
215         tag,
216         _internal_metadata_.mutable_unknown_fields<std::string>(),
217         ptr, ctx);
218     CHK_(ptr != nullptr);
219   }  // while
220 message_done:
221   _impl_._has_bits_.Or(has_bits);
222   return ptr;
223 failure:
224   ptr = nullptr;
225   goto message_done;
226 #undef CHK_
227 }
228 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const229 ::uint8_t* EncryptedData::_InternalSerialize(
230     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
231   // @@protoc_insertion_point(serialize_to_array_start:keystore.EncryptedData)
232   ::uint32_t cached_has_bits = 0;
233   (void) cached_has_bits;
234 
235   cached_has_bits = _impl_._has_bits_[0];
236   // optional bytes init_vector = 1;
237   if (cached_has_bits & 0x00000001u) {
238     target = stream->WriteBytesMaybeAliased(
239         1, this->_internal_init_vector(), target);
240   }
241 
242   // optional bytes authentication_data = 2;
243   if (cached_has_bits & 0x00000002u) {
244     target = stream->WriteBytesMaybeAliased(
245         2, this->_internal_authentication_data(), target);
246   }
247 
248   // optional bytes encrypted_data = 3;
249   if (cached_has_bits & 0x00000004u) {
250     target = stream->WriteBytesMaybeAliased(
251         3, this->_internal_encrypted_data(), target);
252   }
253 
254   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
255     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
256         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
257   }
258   // @@protoc_insertion_point(serialize_to_array_end:keystore.EncryptedData)
259   return target;
260 }
261 
ByteSizeLong() const262 size_t EncryptedData::ByteSizeLong() const {
263 // @@protoc_insertion_point(message_byte_size_start:keystore.EncryptedData)
264   size_t total_size = 0;
265 
266   ::uint32_t cached_has_bits = 0;
267   // Prevent compiler warnings about cached_has_bits being unused
268   (void) cached_has_bits;
269 
270   cached_has_bits = _impl_._has_bits_[0];
271   if (cached_has_bits & 0x00000007u) {
272     // optional bytes init_vector = 1;
273     if (cached_has_bits & 0x00000001u) {
274       total_size += 1 +
275         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
276           this->_internal_init_vector());
277     }
278 
279     // optional bytes authentication_data = 2;
280     if (cached_has_bits & 0x00000002u) {
281       total_size += 1 +
282         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
283           this->_internal_authentication_data());
284     }
285 
286     // optional bytes encrypted_data = 3;
287     if (cached_has_bits & 0x00000004u) {
288       total_size += 1 +
289         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
290           this->_internal_encrypted_data());
291     }
292 
293   }
294   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
295     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
296   }
297   int cached_size = ::_pbi::ToCachedSize(total_size);
298   SetCachedSize(cached_size);
299   return total_size;
300 }
301 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)302 void EncryptedData::CheckTypeAndMergeFrom(
303     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
304   MergeFrom(*::_pbi::DownCast<const EncryptedData*>(
305       &from));
306 }
307 
MergeFrom(const EncryptedData & from)308 void EncryptedData::MergeFrom(const EncryptedData& from) {
309   EncryptedData* const _this = this;
310   // @@protoc_insertion_point(class_specific_merge_from_start:keystore.EncryptedData)
311   GOOGLE_DCHECK_NE(&from, _this);
312   ::uint32_t cached_has_bits = 0;
313   (void) cached_has_bits;
314 
315   cached_has_bits = from._impl_._has_bits_[0];
316   if (cached_has_bits & 0x00000007u) {
317     if (cached_has_bits & 0x00000001u) {
318       _this->_internal_set_init_vector(from._internal_init_vector());
319     }
320     if (cached_has_bits & 0x00000002u) {
321       _this->_internal_set_authentication_data(from._internal_authentication_data());
322     }
323     if (cached_has_bits & 0x00000004u) {
324       _this->_internal_set_encrypted_data(from._internal_encrypted_data());
325     }
326   }
327   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
328 }
329 
CopyFrom(const EncryptedData & from)330 void EncryptedData::CopyFrom(const EncryptedData& from) {
331 // @@protoc_insertion_point(class_specific_copy_from_start:keystore.EncryptedData)
332   if (&from == this) return;
333   Clear();
334   MergeFrom(from);
335 }
336 
IsInitialized() const337 bool EncryptedData::IsInitialized() const {
338   return true;
339 }
340 
InternalSwap(EncryptedData * other)341 void EncryptedData::InternalSwap(EncryptedData* other) {
342   using std::swap;
343   auto* lhs_arena = GetArenaForAllocation();
344   auto* rhs_arena = other->GetArenaForAllocation();
345   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
346   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
347   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
348       &_impl_.init_vector_, lhs_arena,
349       &other->_impl_.init_vector_, rhs_arena
350   );
351   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
352       &_impl_.authentication_data_, lhs_arena,
353       &other->_impl_.authentication_data_, rhs_arena
354   );
355   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
356       &_impl_.encrypted_data_, lhs_arena,
357       &other->_impl_.encrypted_data_, rhs_arena
358   );
359 }
360 
GetTypeName() const361 std::string EncryptedData::GetTypeName() const {
362   return "keystore.EncryptedData";
363 }
364 
365 
366 // @@protoc_insertion_point(namespace_scope)
367 }  // namespace keystore
368 PROTOBUF_NAMESPACE_OPEN
369 template<> PROTOBUF_NOINLINE ::keystore::EncryptedData*
CreateMaybeMessage(Arena * arena)370 Arena::CreateMaybeMessage< ::keystore::EncryptedData >(Arena* arena) {
371   return Arena::CreateMessageInternal< ::keystore::EncryptedData >(arena);
372 }
373 PROTOBUF_NAMESPACE_CLOSE
374 
375 // @@protoc_insertion_point(global_scope)
376 #include <google/protobuf/port_undef.inc>
377