Browse Source

Works on Graphene - with old opt/intel sdk

dettanym 5 years ago
commit
13a923fe83

+ 70 - 0
Makefile

@@ -0,0 +1,70 @@
+CXX             = g++
+RM              = rm -f
+CXX_FLAGS       = -Wall  -O2 -std=c++11 -fpic -fdata-sections -ffunction-sections
+LD              = ${CXX} -v
+LD_FLAGS        = -Wall -shared -O2
+
+#all_non_sgx_cpp := $(filter-out((wildcard *.cpp), $(sgx_cpp))) #main.cpp ipc.cpp SealerWrapper.cpp ProtobufLAMessages.cpp ProtobufSealerMessages.cpp
+all_non_sgx_obj := $(system_obj) $(protobuf_obj) #$(patsubst %.cpp,%.o,$(all_non_sgx_cpp)}
+#main_system_and_wrapper_cpp			= $(filter-out(wildcard *.cpp, $(sgx_cpp) $(protobuf_cpp) $(protobuf_sgx_cpp)))
+#sgx_cpp = $(wildcard Sgx*)
+all_non_sgx_cpp := $(patsubst %.o,%.cpp,$(all_non_sgx_obj))
+sgx_protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard SgxProtobuf*))
+sgx_obj := $(patsubst %.cpp,%.o,$(wildcard Sgx*))
+#sgx_only_obj := $(filter-out($(sgx_obj), $(sgx_protobuf_obj)))
+protobuf_obj := $(patsubst %.cpp,%.o,$(wildcard Protobuf*))
+system_obj := $(patsubst %.cpp,%.o,$(wildcard system*))
+OBJECTS := systemMain.o systemIpc.o systemSealerWrapper.o SgxCrypto.o SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} ${protobuf_obj} #$(system_obj) $(sgx_only_obj) $(sgx_protobuf_obj) $(protobuf_obj)
+
+SGX_SDK ?= /opt/intel/sgxsdk#/home/m2mazmud/sgx2.1_installation/sgxsdk
+SGX_COMMON_CFLAGS := -m64
+SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
+Trts_Library_Name := sgx_trts
+Service_Library_Name := sgx_tservice
+Crypto_Library_Name := sgx_tcrypto
+SGX_INCLUDE_PATHS := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
+
+Uae_Library_Name := sgx_uae_service
+
+
+all:	verifier ${OBJECTS}
+
+#${RESULT}: ${OBJECTS} ${LocalAttestationCode_objects} ${LocalAttestationCode_ipc_objects} ${LocalAttestationCode_serialization_objects}
+#	$(LD) $(LD_FLAGS) -o $@ $^ -Wl,--no-undefined -lphpcpp -lprotobuf -L./  -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive -L$(SGX_LIBRARY_PATH)  -l$(Service_Library_Name) -l$(Crypto_Library_Name) -lsgx_tstdc -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections
+
+clean:
+	${RM} *.obj *~* ${OBJECTS} verifier #${LocalAttestationCode_objects} ${LocalAttestationCode_ipc_objects} ${LocalAttestationCode_serialization_objects}
+
+#SgxLAInititator.o and SgxSealer.o
+#SgxLAInititator.o: SgxLAInititator.cpp
+#	${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c  $^ -o $@ #TODO: Else try sgx_include_paths
+#SgxSealer.o: SgxSealer.cpp
+#	${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
+
+
+#ProtobufSgxLATransforms_Inititator.o and ProtobufSgxSealerTransforms.o
+#ProtobufSgxLATransforms_Inititator.o: ProtobufSgxLATransforms_Inititator.cpp
+#	${CXX} -I./include -I$(SGX_SDK)/include  ${CXX_FLAGS} -c $^ -o $@
+#ProtobufSgxSealerTransforms.o: ProtobufSgxSealerTransforms.cpp
+#	${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
+Sgx%.o: Sgx%.cpp
+	${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
+#SgxSealer.o: SgxSealer.cpp
+#        ${CXX} -I./include -I$(SGX_SDK)/include ${CXX_FLAGS} -c $^ -o $@
+#SgxLAInititator.o: SgxLAInititator
+
+
+#$(all_non_sgx_obj): $(all_non_sgx_cpp)
+#	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
+Protobuf%.o: Protobuf%.cpp
+	${CXX} -I./include ${CXX_FLAGS} -c $^ -o $@
+
+system%.o: system%.cpp
+	gcc -I./include ${CXX_FLAGS} -c $^ -o $@
+
+#system%.o: system%.s
+#	gcc ${CXX_FLAGS} -o $@ $^
+
+verifier:  systemMain.o systemIpc.o systemSealerWrapper.o  SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} ${protobuf_obj}
+#	echo $(system_obj)
+	${CXX} ${CXX_FLAGS} -Wl,--no-undefined systemMain.o systemIpc.o systemSealerWrapper.o SgxSealer.o SgxLAInitiator.o ${sgx_protobuf_obj} -L./ -Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive  -L$(SGX_LIBRARY_PATH)  -l$(Service_Library_Name) -l$(Crypto_Library_Name) -l$(Uae_Library_Name) -lsgx_tstdc -lsgx_urts ${protobuf_obj} -lprotobuf -Wl,--verbose -o $@

+ 2997 - 0
ProtobufLAMessages.pb.cpp

@@ -0,0 +1,2997 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ProtobufLAMessages.proto
+
+#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
+#include "ProtobufLAMessages.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/common.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)
+
+void protobuf_ShutdownFile_ProtobufLAMessages_2eproto() {
+  delete protobuf_sgx_attributes_t::default_instance_;
+  delete protobuf_sgx_ec256_public_t::default_instance_;
+  delete protobuf_sgx_report_body_t::default_instance_;
+  delete protobuf_sgx_report_t::default_instance_;
+  delete protobuf_sgx_target_info_t::default_instance_;
+  delete protobuf_sgx_dh_msg1_t::default_instance_;
+  delete protobuf_sgx_dh_msg2_t::default_instance_;
+  delete protobuf_sgx_dh_msg3_body_t::default_instance_;
+  delete protobuf_sgx_dh_msg3_t::default_instance_;
+}
+
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+void protobuf_AddDesc_ProtobufLAMessages_2eproto_impl() {
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#else
+void protobuf_AddDesc_ProtobufLAMessages_2eproto() {
+  static bool already_here = false;
+  if (already_here) return;
+  already_here = true;
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+#endif
+  protobuf_sgx_attributes_t::default_instance_ = new protobuf_sgx_attributes_t();
+  protobuf_sgx_ec256_public_t::default_instance_ = new protobuf_sgx_ec256_public_t();
+  protobuf_sgx_report_body_t::default_instance_ = new protobuf_sgx_report_body_t();
+  protobuf_sgx_report_t::default_instance_ = new protobuf_sgx_report_t();
+  protobuf_sgx_target_info_t::default_instance_ = new protobuf_sgx_target_info_t();
+  protobuf_sgx_dh_msg1_t::default_instance_ = new protobuf_sgx_dh_msg1_t();
+  protobuf_sgx_dh_msg2_t::default_instance_ = new protobuf_sgx_dh_msg2_t();
+  protobuf_sgx_dh_msg3_body_t::default_instance_ = new protobuf_sgx_dh_msg3_body_t();
+  protobuf_sgx_dh_msg3_t::default_instance_ = new protobuf_sgx_dh_msg3_t();
+  protobuf_sgx_attributes_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_ec256_public_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_report_body_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_report_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_target_info_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_dh_msg1_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_dh_msg2_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_dh_msg3_body_t::default_instance_->InitAsDefaultInstance();
+  protobuf_sgx_dh_msg3_t::default_instance_->InitAsDefaultInstance();
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ProtobufLAMessages_2eproto);
+}
+
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AddDesc_ProtobufLAMessages_2eproto_once_);
+void protobuf_AddDesc_ProtobufLAMessages_2eproto() {
+  ::google::protobuf::GoogleOnceInit(&protobuf_AddDesc_ProtobufLAMessages_2eproto_once_,
+                 &protobuf_AddDesc_ProtobufLAMessages_2eproto_impl);
+}
+#else
+// Force AddDescriptors() to be called at static initialization time.
+struct StaticDescriptorInitializer_ProtobufLAMessages_2eproto {
+  StaticDescriptorInitializer_ProtobufLAMessages_2eproto() {
+    protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  }
+} static_descriptor_initializer_ProtobufLAMessages_2eproto_;
+#endif
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_attributes_t::kFlagsFieldNumber;
+const int protobuf_sgx_attributes_t::kXfrmFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_attributes_t::protobuf_sgx_attributes_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_attributes_t)
+}
+
+void protobuf_sgx_attributes_t::InitAsDefaultInstance() {
+}
+
+protobuf_sgx_attributes_t::protobuf_sgx_attributes_t(const protobuf_sgx_attributes_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_attributes_t)
+}
+
+void protobuf_sgx_attributes_t::SharedCtor() {
+  _cached_size_ = 0;
+  flags_ = GOOGLE_ULONGLONG(0);
+  xfrm_ = GOOGLE_ULONGLONG(0);
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_attributes_t::~protobuf_sgx_attributes_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_attributes_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_attributes_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+  }
+}
+
+void protobuf_sgx_attributes_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_attributes_t& protobuf_sgx_attributes_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_attributes_t* protobuf_sgx_attributes_t::default_instance_ = NULL;
+
+protobuf_sgx_attributes_t* protobuf_sgx_attributes_t::New() const {
+  return new protobuf_sgx_attributes_t;
+}
+
+void protobuf_sgx_attributes_t::Clear() {
+#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
+  &reinterpret_cast<protobuf_sgx_attributes_t*>(16)->f) - \
+   reinterpret_cast<char*>(16))
+
+#define ZR_(first, last) do {                              \
+    size_t f = OFFSET_OF_FIELD_(first);                    \
+    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \
+    ::memset(&first, 0, n);                                \
+  } while (0)
+
+  ZR_(flags_, xfrm_);
+
+#undef OFFSET_OF_FIELD_
+#undef ZR_
+
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_attributes_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_attributes_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required uint64 flags = 1;
+      case 1: {
+        if (tag == 8) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &flags_)));
+          set_has_flags();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(16)) goto parse_xfrm;
+        break;
+      }
+
+      // required uint64 xfrm = 2;
+      case 2: {
+        if (tag == 16) {
+         parse_xfrm:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
+                 input, &xfrm_)));
+          set_has_xfrm();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_attributes_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_attributes_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_attributes_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_attributes_t)
+  // required uint64 flags = 1;
+  if (has_flags()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->flags(), output);
+  }
+
+  // required uint64 xfrm = 2;
+  if (has_xfrm()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->xfrm(), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_attributes_t)
+}
+
+int protobuf_sgx_attributes_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required uint64 flags = 1;
+    if (has_flags()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->flags());
+    }
+
+    // required uint64 xfrm = 2;
+    if (has_xfrm()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt64Size(
+          this->xfrm());
+    }
+
+  }
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_attributes_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_attributes_t*>(&from));
+}
+
+void protobuf_sgx_attributes_t::MergeFrom(const protobuf_sgx_attributes_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_flags()) {
+      set_flags(from.flags());
+    }
+    if (from.has_xfrm()) {
+      set_xfrm(from.xfrm());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_attributes_t::CopyFrom(const protobuf_sgx_attributes_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_attributes_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+
+  return true;
+}
+
+void protobuf_sgx_attributes_t::Swap(protobuf_sgx_attributes_t* other) {
+  if (other != this) {
+    std::swap(flags_, other->flags_);
+    std::swap(xfrm_, other->xfrm_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_attributes_t::GetTypeName() const {
+  return "protobuf_sgx_attributes_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_ec256_public_t::kGxFieldNumber;
+const int protobuf_sgx_ec256_public_t::kGyFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_ec256_public_t::protobuf_sgx_ec256_public_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_ec256_public_t)
+}
+
+void protobuf_sgx_ec256_public_t::InitAsDefaultInstance() {
+}
+
+protobuf_sgx_ec256_public_t::protobuf_sgx_ec256_public_t(const protobuf_sgx_ec256_public_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_ec256_public_t)
+}
+
+void protobuf_sgx_ec256_public_t::SharedCtor() {
+  _cached_size_ = 0;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_ec256_public_t::~protobuf_sgx_ec256_public_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_ec256_public_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_ec256_public_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+  }
+}
+
+void protobuf_sgx_ec256_public_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_ec256_public_t& protobuf_sgx_ec256_public_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_ec256_public_t* protobuf_sgx_ec256_public_t::default_instance_ = NULL;
+
+protobuf_sgx_ec256_public_t* protobuf_sgx_ec256_public_t::New() const {
+  return new protobuf_sgx_ec256_public_t;
+}
+
+void protobuf_sgx_ec256_public_t::Clear() {
+  gx_.Clear();
+  gy_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_ec256_public_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_ec256_public_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // repeated uint32 gx = 1 [packed = true];
+      case 1: {
+        if (tag == 10) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_gx())));
+        } else if (tag == 8) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 10, input, this->mutable_gx())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_gy;
+        break;
+      }
+
+      // repeated uint32 gy = 2 [packed = true];
+      case 2: {
+        if (tag == 18) {
+         parse_gy:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_gy())));
+        } else if (tag == 16) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 18, input, this->mutable_gy())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_ec256_public_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_ec256_public_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_ec256_public_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_ec256_public_t)
+  // repeated uint32 gx = 1 [packed = true];
+  if (this->gx_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_gx_cached_byte_size_);
+  }
+  for (int i = 0; i < this->gx_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->gx(i), output);
+  }
+
+  // repeated uint32 gy = 2 [packed = true];
+  if (this->gy_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_gy_cached_byte_size_);
+  }
+  for (int i = 0; i < this->gy_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->gy(i), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_ec256_public_t)
+}
+
+int protobuf_sgx_ec256_public_t::ByteSize() const {
+  int total_size = 0;
+
+  // repeated uint32 gx = 1 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->gx_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->gx(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _gx_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 gy = 2 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->gy_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->gy(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _gy_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_ec256_public_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_ec256_public_t*>(&from));
+}
+
+void protobuf_sgx_ec256_public_t::MergeFrom(const protobuf_sgx_ec256_public_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  gx_.MergeFrom(from.gx_);
+  gy_.MergeFrom(from.gy_);
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_ec256_public_t::CopyFrom(const protobuf_sgx_ec256_public_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_ec256_public_t::IsInitialized() const {
+
+  return true;
+}
+
+void protobuf_sgx_ec256_public_t::Swap(protobuf_sgx_ec256_public_t* other) {
+  if (other != this) {
+    gx_.Swap(&other->gx_);
+    gy_.Swap(&other->gy_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_ec256_public_t::GetTypeName() const {
+  return "protobuf_sgx_ec256_public_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_report_body_t::kCpuSvnFieldNumber;
+const int protobuf_sgx_report_body_t::kMiscSelectFieldNumber;
+const int protobuf_sgx_report_body_t::kReserved1FieldNumber;
+const int protobuf_sgx_report_body_t::kAttributesFieldNumber;
+const int protobuf_sgx_report_body_t::kMrEnclaveFieldNumber;
+const int protobuf_sgx_report_body_t::kReserved2FieldNumber;
+const int protobuf_sgx_report_body_t::kMrSignerFieldNumber;
+const int protobuf_sgx_report_body_t::kReserved3FieldNumber;
+const int protobuf_sgx_report_body_t::kIsvProdIdFieldNumber;
+const int protobuf_sgx_report_body_t::kIsvSvnFieldNumber;
+const int protobuf_sgx_report_body_t::kReserved4FieldNumber;
+const int protobuf_sgx_report_body_t::kReportDataFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_report_body_t::protobuf_sgx_report_body_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_report_body_t)
+}
+
+void protobuf_sgx_report_body_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  attributes_ = const_cast< ::protobuf_sgx_attributes_t*>(
+      ::protobuf_sgx_attributes_t::internal_default_instance());
+#else
+  attributes_ = const_cast< ::protobuf_sgx_attributes_t*>(&::protobuf_sgx_attributes_t::default_instance());
+#endif
+}
+
+protobuf_sgx_report_body_t::protobuf_sgx_report_body_t(const protobuf_sgx_report_body_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_report_body_t)
+}
+
+void protobuf_sgx_report_body_t::SharedCtor() {
+  _cached_size_ = 0;
+  misc_select_ = 0u;
+  attributes_ = NULL;
+  isv_prod_id_ = 0u;
+  isv_svn_ = 0u;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_report_body_t::~protobuf_sgx_report_body_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_report_body_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_report_body_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete attributes_;
+  }
+}
+
+void protobuf_sgx_report_body_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_report_body_t& protobuf_sgx_report_body_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_report_body_t* protobuf_sgx_report_body_t::default_instance_ = NULL;
+
+protobuf_sgx_report_body_t* protobuf_sgx_report_body_t::New() const {
+  return new protobuf_sgx_report_body_t;
+}
+
+void protobuf_sgx_report_body_t::Clear() {
+  if (_has_bits_[0 / 32] & 10) {
+    misc_select_ = 0u;
+    if (has_attributes()) {
+      if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+    }
+  }
+  if (_has_bits_[8 / 32] & 768) {
+    isv_prod_id_ = 0u;
+    isv_svn_ = 0u;
+  }
+  cpu_svn_.Clear();
+  reserved1_.Clear();
+  mr_enclave_.Clear();
+  reserved2_.Clear();
+  mr_signer_.Clear();
+  reserved3_.Clear();
+  reserved4_.Clear();
+  report_data_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_report_body_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_report_body_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // repeated uint32 cpu_svn = 1 [packed = true];
+      case 1: {
+        if (tag == 10) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_cpu_svn())));
+        } else if (tag == 8) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 10, input, this->mutable_cpu_svn())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_reserved1;
+        break;
+      }
+
+      // repeated uint32 reserved1 = 2 [packed = true];
+      case 2: {
+        if (tag == 18) {
+         parse_reserved1:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved1())));
+        } else if (tag == 16) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 18, input, this->mutable_reserved1())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(26)) goto parse_mr_enclave;
+        break;
+      }
+
+      // repeated uint32 mr_enclave = 3 [packed = true];
+      case 3: {
+        if (tag == 26) {
+         parse_mr_enclave:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_mr_enclave())));
+        } else if (tag == 24) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 26, input, this->mutable_mr_enclave())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(34)) goto parse_reserved2;
+        break;
+      }
+
+      // repeated uint32 reserved2 = 4 [packed = true];
+      case 4: {
+        if (tag == 34) {
+         parse_reserved2:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved2())));
+        } else if (tag == 32) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 34, input, this->mutable_reserved2())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(42)) goto parse_mr_signer;
+        break;
+      }
+
+      // repeated uint32 mr_signer = 5 [packed = true];
+      case 5: {
+        if (tag == 42) {
+         parse_mr_signer:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_mr_signer())));
+        } else if (tag == 40) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 42, input, this->mutable_mr_signer())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(50)) goto parse_reserved3;
+        break;
+      }
+
+      // repeated uint32 reserved3 = 6 [packed = true];
+      case 6: {
+        if (tag == 50) {
+         parse_reserved3:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved3())));
+        } else if (tag == 48) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 50, input, this->mutable_reserved3())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(58)) goto parse_reserved4;
+        break;
+      }
+
+      // repeated uint32 reserved4 = 7 [packed = true];
+      case 7: {
+        if (tag == 58) {
+         parse_reserved4:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved4())));
+        } else if (tag == 56) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 58, input, this->mutable_reserved4())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(66)) goto parse_report_data;
+        break;
+      }
+
+      // repeated uint32 report_data = 8 [packed = true];
+      case 8: {
+        if (tag == 66) {
+         parse_report_data:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_report_data())));
+        } else if (tag == 64) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 66, input, this->mutable_report_data())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(72)) goto parse_misc_select;
+        break;
+      }
+
+      // required uint32 misc_select = 9;
+      case 9: {
+        if (tag == 72) {
+         parse_misc_select:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &misc_select_)));
+          set_has_misc_select();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(82)) goto parse_attributes;
+        break;
+      }
+
+      // required .protobuf_sgx_attributes_t attributes = 10;
+      case 10: {
+        if (tag == 82) {
+         parse_attributes:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_attributes()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(88)) goto parse_isv_prod_id;
+        break;
+      }
+
+      // required uint32 isv_prod_id = 11;
+      case 11: {
+        if (tag == 88) {
+         parse_isv_prod_id:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &isv_prod_id_)));
+          set_has_isv_prod_id();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(96)) goto parse_isv_svn;
+        break;
+      }
+
+      // required uint32 isv_svn = 12;
+      case 12: {
+        if (tag == 96) {
+         parse_isv_svn:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &isv_svn_)));
+          set_has_isv_svn();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_report_body_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_report_body_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_report_body_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_report_body_t)
+  // repeated uint32 cpu_svn = 1 [packed = true];
+  if (this->cpu_svn_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_cpu_svn_cached_byte_size_);
+  }
+  for (int i = 0; i < this->cpu_svn_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->cpu_svn(i), output);
+  }
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  if (this->reserved1_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved1_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved1_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved1(i), output);
+  }
+
+  // repeated uint32 mr_enclave = 3 [packed = true];
+  if (this->mr_enclave_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_mr_enclave_cached_byte_size_);
+  }
+  for (int i = 0; i < this->mr_enclave_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->mr_enclave(i), output);
+  }
+
+  // repeated uint32 reserved2 = 4 [packed = true];
+  if (this->reserved2_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(4, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved2_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved2_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved2(i), output);
+  }
+
+  // repeated uint32 mr_signer = 5 [packed = true];
+  if (this->mr_signer_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(5, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_mr_signer_cached_byte_size_);
+  }
+  for (int i = 0; i < this->mr_signer_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->mr_signer(i), output);
+  }
+
+  // repeated uint32 reserved3 = 6 [packed = true];
+  if (this->reserved3_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(6, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved3_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved3_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved3(i), output);
+  }
+
+  // repeated uint32 reserved4 = 7 [packed = true];
+  if (this->reserved4_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(7, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved4_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved4_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved4(i), output);
+  }
+
+  // repeated uint32 report_data = 8 [packed = true];
+  if (this->report_data_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(8, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_report_data_cached_byte_size_);
+  }
+  for (int i = 0; i < this->report_data_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->report_data(i), output);
+  }
+
+  // required uint32 misc_select = 9;
+  if (has_misc_select()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->misc_select(), output);
+  }
+
+  // required .protobuf_sgx_attributes_t attributes = 10;
+  if (has_attributes()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      10, this->attributes(), output);
+  }
+
+  // required uint32 isv_prod_id = 11;
+  if (has_isv_prod_id()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->isv_prod_id(), output);
+  }
+
+  // required uint32 isv_svn = 12;
+  if (has_isv_svn()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->isv_svn(), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_report_body_t)
+}
+
+int protobuf_sgx_report_body_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    // required uint32 misc_select = 9;
+    if (has_misc_select()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->misc_select());
+    }
+
+    // required .protobuf_sgx_attributes_t attributes = 10;
+    if (has_attributes()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->attributes());
+    }
+
+  }
+  if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    // required uint32 isv_prod_id = 11;
+    if (has_isv_prod_id()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->isv_prod_id());
+    }
+
+    // required uint32 isv_svn = 12;
+    if (has_isv_svn()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->isv_svn());
+    }
+
+  }
+  // repeated uint32 cpu_svn = 1 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->cpu_svn_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->cpu_svn(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _cpu_svn_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved1_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved1(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved1_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 mr_enclave = 3 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->mr_enclave_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->mr_enclave(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _mr_enclave_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved2 = 4 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved2_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved2(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved2_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 mr_signer = 5 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->mr_signer_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->mr_signer(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _mr_signer_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved3 = 6 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved3_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved3(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved3_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved4 = 7 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved4_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved4(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved4_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 report_data = 8 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->report_data_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->report_data(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _report_data_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_report_body_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_report_body_t*>(&from));
+}
+
+void protobuf_sgx_report_body_t::MergeFrom(const protobuf_sgx_report_body_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  cpu_svn_.MergeFrom(from.cpu_svn_);
+  reserved1_.MergeFrom(from.reserved1_);
+  mr_enclave_.MergeFrom(from.mr_enclave_);
+  reserved2_.MergeFrom(from.reserved2_);
+  mr_signer_.MergeFrom(from.mr_signer_);
+  reserved3_.MergeFrom(from.reserved3_);
+  reserved4_.MergeFrom(from.reserved4_);
+  report_data_.MergeFrom(from.report_data_);
+  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    if (from.has_misc_select()) {
+      set_misc_select(from.misc_select());
+    }
+    if (from.has_attributes()) {
+      mutable_attributes()->::protobuf_sgx_attributes_t::MergeFrom(from.attributes());
+    }
+  }
+  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
+    if (from.has_isv_prod_id()) {
+      set_isv_prod_id(from.isv_prod_id());
+    }
+    if (from.has_isv_svn()) {
+      set_isv_svn(from.isv_svn());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_report_body_t::CopyFrom(const protobuf_sgx_report_body_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_report_body_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x0000030a) != 0x0000030a) return false;
+
+  if (has_attributes()) {
+    if (!this->attributes().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_report_body_t::Swap(protobuf_sgx_report_body_t* other) {
+  if (other != this) {
+    cpu_svn_.Swap(&other->cpu_svn_);
+    std::swap(misc_select_, other->misc_select_);
+    reserved1_.Swap(&other->reserved1_);
+    std::swap(attributes_, other->attributes_);
+    mr_enclave_.Swap(&other->mr_enclave_);
+    reserved2_.Swap(&other->reserved2_);
+    mr_signer_.Swap(&other->mr_signer_);
+    reserved3_.Swap(&other->reserved3_);
+    std::swap(isv_prod_id_, other->isv_prod_id_);
+    std::swap(isv_svn_, other->isv_svn_);
+    reserved4_.Swap(&other->reserved4_);
+    report_data_.Swap(&other->report_data_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_report_body_t::GetTypeName() const {
+  return "protobuf_sgx_report_body_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_report_t::kBodyFieldNumber;
+const int protobuf_sgx_report_t::kKeyIdFieldNumber;
+const int protobuf_sgx_report_t::kMacFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_report_t::protobuf_sgx_report_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_report_t)
+}
+
+void protobuf_sgx_report_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  body_ = const_cast< ::protobuf_sgx_report_body_t*>(
+      ::protobuf_sgx_report_body_t::internal_default_instance());
+#else
+  body_ = const_cast< ::protobuf_sgx_report_body_t*>(&::protobuf_sgx_report_body_t::default_instance());
+#endif
+}
+
+protobuf_sgx_report_t::protobuf_sgx_report_t(const protobuf_sgx_report_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_report_t)
+}
+
+void protobuf_sgx_report_t::SharedCtor() {
+  _cached_size_ = 0;
+  body_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_report_t::~protobuf_sgx_report_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_report_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_report_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete body_;
+  }
+}
+
+void protobuf_sgx_report_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_report_t& protobuf_sgx_report_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_report_t* protobuf_sgx_report_t::default_instance_ = NULL;
+
+protobuf_sgx_report_t* protobuf_sgx_report_t::New() const {
+  return new protobuf_sgx_report_t;
+}
+
+void protobuf_sgx_report_t::Clear() {
+  if (has_body()) {
+    if (body_ != NULL) body_->::protobuf_sgx_report_body_t::Clear();
+  }
+  key_id_.Clear();
+  mac_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_report_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_report_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_report_body_t body = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_body()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_key_id;
+        break;
+      }
+
+      // repeated uint32 key_id = 2 [packed = true];
+      case 2: {
+        if (tag == 18) {
+         parse_key_id:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_key_id())));
+        } else if (tag == 16) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 18, input, this->mutable_key_id())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(26)) goto parse_mac;
+        break;
+      }
+
+      // repeated uint32 mac = 3 [packed = true];
+      case 3: {
+        if (tag == 26) {
+         parse_mac:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_mac())));
+        } else if (tag == 24) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 26, input, this->mutable_mac())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_report_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_report_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_report_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_report_t)
+  // required .protobuf_sgx_report_body_t body = 1;
+  if (has_body()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      1, this->body(), output);
+  }
+
+  // repeated uint32 key_id = 2 [packed = true];
+  if (this->key_id_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_key_id_cached_byte_size_);
+  }
+  for (int i = 0; i < this->key_id_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->key_id(i), output);
+  }
+
+  // repeated uint32 mac = 3 [packed = true];
+  if (this->mac_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_mac_cached_byte_size_);
+  }
+  for (int i = 0; i < this->mac_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->mac(i), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_report_t)
+}
+
+int protobuf_sgx_report_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_report_body_t body = 1;
+    if (has_body()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->body());
+    }
+
+  }
+  // repeated uint32 key_id = 2 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->key_id_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->key_id(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _key_id_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 mac = 3 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->mac_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->mac(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _mac_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_report_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_report_t*>(&from));
+}
+
+void protobuf_sgx_report_t::MergeFrom(const protobuf_sgx_report_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  key_id_.MergeFrom(from.key_id_);
+  mac_.MergeFrom(from.mac_);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_body()) {
+      mutable_body()->::protobuf_sgx_report_body_t::MergeFrom(from.body());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_report_t::CopyFrom(const protobuf_sgx_report_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_report_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+
+  if (has_body()) {
+    if (!this->body().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_report_t::Swap(protobuf_sgx_report_t* other) {
+  if (other != this) {
+    std::swap(body_, other->body_);
+    key_id_.Swap(&other->key_id_);
+    mac_.Swap(&other->mac_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_report_t::GetTypeName() const {
+  return "protobuf_sgx_report_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_target_info_t::kMrEnclaveFieldNumber;
+const int protobuf_sgx_target_info_t::kAttributesFieldNumber;
+const int protobuf_sgx_target_info_t::kReserved1FieldNumber;
+const int protobuf_sgx_target_info_t::kMiscSelectFieldNumber;
+const int protobuf_sgx_target_info_t::kReserved2FieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_target_info_t::protobuf_sgx_target_info_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_target_info_t)
+}
+
+void protobuf_sgx_target_info_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  attributes_ = const_cast< ::protobuf_sgx_attributes_t*>(
+      ::protobuf_sgx_attributes_t::internal_default_instance());
+#else
+  attributes_ = const_cast< ::protobuf_sgx_attributes_t*>(&::protobuf_sgx_attributes_t::default_instance());
+#endif
+}
+
+protobuf_sgx_target_info_t::protobuf_sgx_target_info_t(const protobuf_sgx_target_info_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_target_info_t)
+}
+
+void protobuf_sgx_target_info_t::SharedCtor() {
+  _cached_size_ = 0;
+  attributes_ = NULL;
+  misc_select_ = 0u;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_target_info_t::~protobuf_sgx_target_info_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_target_info_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_target_info_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete attributes_;
+  }
+}
+
+void protobuf_sgx_target_info_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_target_info_t& protobuf_sgx_target_info_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_target_info_t* protobuf_sgx_target_info_t::default_instance_ = NULL;
+
+protobuf_sgx_target_info_t* protobuf_sgx_target_info_t::New() const {
+  return new protobuf_sgx_target_info_t;
+}
+
+void protobuf_sgx_target_info_t::Clear() {
+  if (_has_bits_[0 / 32] & 10) {
+    if (has_attributes()) {
+      if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+    }
+    misc_select_ = 0u;
+  }
+  mr_enclave_.Clear();
+  reserved1_.Clear();
+  reserved2_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_target_info_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_target_info_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // repeated uint32 mr_enclave = 1 [packed = true];
+      case 1: {
+        if (tag == 10) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_mr_enclave())));
+        } else if (tag == 8) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 10, input, this->mutable_mr_enclave())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_reserved1;
+        break;
+      }
+
+      // repeated uint32 reserved1 = 2 [packed = true];
+      case 2: {
+        if (tag == 18) {
+         parse_reserved1:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved1())));
+        } else if (tag == 16) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 18, input, this->mutable_reserved1())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(26)) goto parse_reserved2;
+        break;
+      }
+
+      // repeated uint32 reserved2 = 3 [packed = true];
+      case 3: {
+        if (tag == 26) {
+         parse_reserved2:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_reserved2())));
+        } else if (tag == 24) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 26, input, this->mutable_reserved2())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(34)) goto parse_attributes;
+        break;
+      }
+
+      // required .protobuf_sgx_attributes_t attributes = 4;
+      case 4: {
+        if (tag == 34) {
+         parse_attributes:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_attributes()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(40)) goto parse_misc_select;
+        break;
+      }
+
+      // required uint32 misc_select = 5;
+      case 5: {
+        if (tag == 40) {
+         parse_misc_select:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &misc_select_)));
+          set_has_misc_select();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_target_info_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_target_info_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_target_info_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_target_info_t)
+  // repeated uint32 mr_enclave = 1 [packed = true];
+  if (this->mr_enclave_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_mr_enclave_cached_byte_size_);
+  }
+  for (int i = 0; i < this->mr_enclave_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->mr_enclave(i), output);
+  }
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  if (this->reserved1_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved1_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved1_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved1(i), output);
+  }
+
+  // repeated uint32 reserved2 = 3 [packed = true];
+  if (this->reserved2_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_reserved2_cached_byte_size_);
+  }
+  for (int i = 0; i < this->reserved2_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->reserved2(i), output);
+  }
+
+  // required .protobuf_sgx_attributes_t attributes = 4;
+  if (has_attributes()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      4, this->attributes(), output);
+  }
+
+  // required uint32 misc_select = 5;
+  if (has_misc_select()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->misc_select(), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_target_info_t)
+}
+
+int protobuf_sgx_target_info_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    // required .protobuf_sgx_attributes_t attributes = 4;
+    if (has_attributes()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->attributes());
+    }
+
+    // required uint32 misc_select = 5;
+    if (has_misc_select()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->misc_select());
+    }
+
+  }
+  // repeated uint32 mr_enclave = 1 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->mr_enclave_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->mr_enclave(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _mr_enclave_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved1_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved1(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved1_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  // repeated uint32 reserved2 = 3 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->reserved2_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->reserved2(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _reserved2_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_target_info_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_target_info_t*>(&from));
+}
+
+void protobuf_sgx_target_info_t::MergeFrom(const protobuf_sgx_target_info_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  mr_enclave_.MergeFrom(from.mr_enclave_);
+  reserved1_.MergeFrom(from.reserved1_);
+  reserved2_.MergeFrom(from.reserved2_);
+  if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) {
+    if (from.has_attributes()) {
+      mutable_attributes()->::protobuf_sgx_attributes_t::MergeFrom(from.attributes());
+    }
+    if (from.has_misc_select()) {
+      set_misc_select(from.misc_select());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_target_info_t::CopyFrom(const protobuf_sgx_target_info_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_target_info_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x0000000a) != 0x0000000a) return false;
+
+  if (has_attributes()) {
+    if (!this->attributes().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_target_info_t::Swap(protobuf_sgx_target_info_t* other) {
+  if (other != this) {
+    mr_enclave_.Swap(&other->mr_enclave_);
+    std::swap(attributes_, other->attributes_);
+    reserved1_.Swap(&other->reserved1_);
+    std::swap(misc_select_, other->misc_select_);
+    reserved2_.Swap(&other->reserved2_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_target_info_t::GetTypeName() const {
+  return "protobuf_sgx_target_info_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_dh_msg1_t::kGAFieldNumber;
+const int protobuf_sgx_dh_msg1_t::kTargetFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_dh_msg1_t::protobuf_sgx_dh_msg1_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_dh_msg1_t)
+}
+
+void protobuf_sgx_dh_msg1_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  g_a_ = const_cast< ::protobuf_sgx_ec256_public_t*>(
+      ::protobuf_sgx_ec256_public_t::internal_default_instance());
+#else
+  g_a_ = const_cast< ::protobuf_sgx_ec256_public_t*>(&::protobuf_sgx_ec256_public_t::default_instance());
+#endif
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  target_ = const_cast< ::protobuf_sgx_target_info_t*>(
+      ::protobuf_sgx_target_info_t::internal_default_instance());
+#else
+  target_ = const_cast< ::protobuf_sgx_target_info_t*>(&::protobuf_sgx_target_info_t::default_instance());
+#endif
+}
+
+protobuf_sgx_dh_msg1_t::protobuf_sgx_dh_msg1_t(const protobuf_sgx_dh_msg1_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_dh_msg1_t)
+}
+
+void protobuf_sgx_dh_msg1_t::SharedCtor() {
+  _cached_size_ = 0;
+  g_a_ = NULL;
+  target_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_dh_msg1_t::~protobuf_sgx_dh_msg1_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_dh_msg1_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_dh_msg1_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete g_a_;
+    delete target_;
+  }
+}
+
+void protobuf_sgx_dh_msg1_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_dh_msg1_t& protobuf_sgx_dh_msg1_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_dh_msg1_t* protobuf_sgx_dh_msg1_t::default_instance_ = NULL;
+
+protobuf_sgx_dh_msg1_t* protobuf_sgx_dh_msg1_t::New() const {
+  return new protobuf_sgx_dh_msg1_t;
+}
+
+void protobuf_sgx_dh_msg1_t::Clear() {
+  if (_has_bits_[0 / 32] & 3) {
+    if (has_g_a()) {
+      if (g_a_ != NULL) g_a_->::protobuf_sgx_ec256_public_t::Clear();
+    }
+    if (has_target()) {
+      if (target_ != NULL) target_->::protobuf_sgx_target_info_t::Clear();
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_dh_msg1_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_dh_msg1_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_ec256_public_t g_a = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_g_a()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_target;
+        break;
+      }
+
+      // required .protobuf_sgx_target_info_t target = 2;
+      case 2: {
+        if (tag == 18) {
+         parse_target:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_target()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_dh_msg1_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_dh_msg1_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_dh_msg1_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_dh_msg1_t)
+  // required .protobuf_sgx_ec256_public_t g_a = 1;
+  if (has_g_a()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      1, this->g_a(), output);
+  }
+
+  // required .protobuf_sgx_target_info_t target = 2;
+  if (has_target()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      2, this->target(), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_dh_msg1_t)
+}
+
+int protobuf_sgx_dh_msg1_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_ec256_public_t g_a = 1;
+    if (has_g_a()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->g_a());
+    }
+
+    // required .protobuf_sgx_target_info_t target = 2;
+    if (has_target()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->target());
+    }
+
+  }
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_dh_msg1_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_dh_msg1_t*>(&from));
+}
+
+void protobuf_sgx_dh_msg1_t::MergeFrom(const protobuf_sgx_dh_msg1_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_g_a()) {
+      mutable_g_a()->::protobuf_sgx_ec256_public_t::MergeFrom(from.g_a());
+    }
+    if (from.has_target()) {
+      mutable_target()->::protobuf_sgx_target_info_t::MergeFrom(from.target());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_dh_msg1_t::CopyFrom(const protobuf_sgx_dh_msg1_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_dh_msg1_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+
+  if (has_target()) {
+    if (!this->target().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_dh_msg1_t::Swap(protobuf_sgx_dh_msg1_t* other) {
+  if (other != this) {
+    std::swap(g_a_, other->g_a_);
+    std::swap(target_, other->target_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_dh_msg1_t::GetTypeName() const {
+  return "protobuf_sgx_dh_msg1_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_dh_msg2_t::kGBFieldNumber;
+const int protobuf_sgx_dh_msg2_t::kReportFieldNumber;
+const int protobuf_sgx_dh_msg2_t::kCmacFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_dh_msg2_t::protobuf_sgx_dh_msg2_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_dh_msg2_t)
+}
+
+void protobuf_sgx_dh_msg2_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  g_b_ = const_cast< ::protobuf_sgx_ec256_public_t*>(
+      ::protobuf_sgx_ec256_public_t::internal_default_instance());
+#else
+  g_b_ = const_cast< ::protobuf_sgx_ec256_public_t*>(&::protobuf_sgx_ec256_public_t::default_instance());
+#endif
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  report_ = const_cast< ::protobuf_sgx_report_t*>(
+      ::protobuf_sgx_report_t::internal_default_instance());
+#else
+  report_ = const_cast< ::protobuf_sgx_report_t*>(&::protobuf_sgx_report_t::default_instance());
+#endif
+}
+
+protobuf_sgx_dh_msg2_t::protobuf_sgx_dh_msg2_t(const protobuf_sgx_dh_msg2_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_dh_msg2_t)
+}
+
+void protobuf_sgx_dh_msg2_t::SharedCtor() {
+  _cached_size_ = 0;
+  g_b_ = NULL;
+  report_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_dh_msg2_t::~protobuf_sgx_dh_msg2_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_dh_msg2_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_dh_msg2_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete g_b_;
+    delete report_;
+  }
+}
+
+void protobuf_sgx_dh_msg2_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_dh_msg2_t& protobuf_sgx_dh_msg2_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_dh_msg2_t* protobuf_sgx_dh_msg2_t::default_instance_ = NULL;
+
+protobuf_sgx_dh_msg2_t* protobuf_sgx_dh_msg2_t::New() const {
+  return new protobuf_sgx_dh_msg2_t;
+}
+
+void protobuf_sgx_dh_msg2_t::Clear() {
+  if (_has_bits_[0 / 32] & 3) {
+    if (has_g_b()) {
+      if (g_b_ != NULL) g_b_->::protobuf_sgx_ec256_public_t::Clear();
+    }
+    if (has_report()) {
+      if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+    }
+  }
+  cmac_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_dh_msg2_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_dh_msg2_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_ec256_public_t g_b = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_g_b()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_report;
+        break;
+      }
+
+      // required .protobuf_sgx_report_t report = 2;
+      case 2: {
+        if (tag == 18) {
+         parse_report:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_report()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(26)) goto parse_cmac;
+        break;
+      }
+
+      // repeated uint32 cmac = 3 [packed = true];
+      case 3: {
+        if (tag == 26) {
+         parse_cmac:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_cmac())));
+        } else if (tag == 24) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 26, input, this->mutable_cmac())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_dh_msg2_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_dh_msg2_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_dh_msg2_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_dh_msg2_t)
+  // required .protobuf_sgx_ec256_public_t g_b = 1;
+  if (has_g_b()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      1, this->g_b(), output);
+  }
+
+  // required .protobuf_sgx_report_t report = 2;
+  if (has_report()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      2, this->report(), output);
+  }
+
+  // repeated uint32 cmac = 3 [packed = true];
+  if (this->cmac_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_cmac_cached_byte_size_);
+  }
+  for (int i = 0; i < this->cmac_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->cmac(i), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_dh_msg2_t)
+}
+
+int protobuf_sgx_dh_msg2_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_ec256_public_t g_b = 1;
+    if (has_g_b()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->g_b());
+    }
+
+    // required .protobuf_sgx_report_t report = 2;
+    if (has_report()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->report());
+    }
+
+  }
+  // repeated uint32 cmac = 3 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->cmac_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->cmac(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _cmac_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_dh_msg2_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_dh_msg2_t*>(&from));
+}
+
+void protobuf_sgx_dh_msg2_t::MergeFrom(const protobuf_sgx_dh_msg2_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  cmac_.MergeFrom(from.cmac_);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_g_b()) {
+      mutable_g_b()->::protobuf_sgx_ec256_public_t::MergeFrom(from.g_b());
+    }
+    if (from.has_report()) {
+      mutable_report()->::protobuf_sgx_report_t::MergeFrom(from.report());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_dh_msg2_t::CopyFrom(const protobuf_sgx_dh_msg2_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_dh_msg2_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+
+  if (has_report()) {
+    if (!this->report().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_dh_msg2_t::Swap(protobuf_sgx_dh_msg2_t* other) {
+  if (other != this) {
+    std::swap(g_b_, other->g_b_);
+    std::swap(report_, other->report_);
+    cmac_.Swap(&other->cmac_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_dh_msg2_t::GetTypeName() const {
+  return "protobuf_sgx_dh_msg2_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_dh_msg3_body_t::kReportFieldNumber;
+const int protobuf_sgx_dh_msg3_body_t::kAdditionalPropFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_dh_msg3_body_t::protobuf_sgx_dh_msg3_body_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_dh_msg3_body_t)
+}
+
+void protobuf_sgx_dh_msg3_body_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  report_ = const_cast< ::protobuf_sgx_report_t*>(
+      ::protobuf_sgx_report_t::internal_default_instance());
+#else
+  report_ = const_cast< ::protobuf_sgx_report_t*>(&::protobuf_sgx_report_t::default_instance());
+#endif
+}
+
+protobuf_sgx_dh_msg3_body_t::protobuf_sgx_dh_msg3_body_t(const protobuf_sgx_dh_msg3_body_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_dh_msg3_body_t)
+}
+
+void protobuf_sgx_dh_msg3_body_t::SharedCtor() {
+  _cached_size_ = 0;
+  report_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_dh_msg3_body_t::~protobuf_sgx_dh_msg3_body_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_dh_msg3_body_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_dh_msg3_body_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete report_;
+  }
+}
+
+void protobuf_sgx_dh_msg3_body_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_dh_msg3_body_t& protobuf_sgx_dh_msg3_body_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_body_t::default_instance_ = NULL;
+
+protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_body_t::New() const {
+  return new protobuf_sgx_dh_msg3_body_t;
+}
+
+void protobuf_sgx_dh_msg3_body_t::Clear() {
+  if (has_report()) {
+    if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+  }
+  additional_prop_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_dh_msg3_body_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_dh_msg3_body_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_report_t report = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_report()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(16)) goto parse_additional_prop;
+        break;
+      }
+
+      // repeated uint32 additional_prop = 2;
+      case 2: {
+        if (tag == 16) {
+         parse_additional_prop:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 16, input, this->mutable_additional_prop())));
+        } else if (tag == 18) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_additional_prop())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(16)) goto parse_additional_prop;
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_dh_msg3_body_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_dh_msg3_body_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_dh_msg3_body_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_dh_msg3_body_t)
+  // required .protobuf_sgx_report_t report = 1;
+  if (has_report()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      1, this->report(), output);
+  }
+
+  // repeated uint32 additional_prop = 2;
+  for (int i = 0; i < this->additional_prop_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
+      2, this->additional_prop(i), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_dh_msg3_body_t)
+}
+
+int protobuf_sgx_dh_msg3_body_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_report_t report = 1;
+    if (has_report()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->report());
+    }
+
+  }
+  // repeated uint32 additional_prop = 2;
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->additional_prop_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->additional_prop(i));
+    }
+    total_size += 1 * this->additional_prop_size() + data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_dh_msg3_body_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_dh_msg3_body_t*>(&from));
+}
+
+void protobuf_sgx_dh_msg3_body_t::MergeFrom(const protobuf_sgx_dh_msg3_body_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  additional_prop_.MergeFrom(from.additional_prop_);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_report()) {
+      mutable_report()->::protobuf_sgx_report_t::MergeFrom(from.report());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_dh_msg3_body_t::CopyFrom(const protobuf_sgx_dh_msg3_body_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_dh_msg3_body_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+
+  if (has_report()) {
+    if (!this->report().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_dh_msg3_body_t::Swap(protobuf_sgx_dh_msg3_body_t* other) {
+  if (other != this) {
+    std::swap(report_, other->report_);
+    additional_prop_.Swap(&other->additional_prop_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_dh_msg3_body_t::GetTypeName() const {
+  return "protobuf_sgx_dh_msg3_body_t";
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_dh_msg3_t::kMsg3BodyFieldNumber;
+const int protobuf_sgx_dh_msg3_t::kCmacFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_dh_msg3_t::protobuf_sgx_dh_msg3_t()
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_dh_msg3_t)
+}
+
+void protobuf_sgx_dh_msg3_t::InitAsDefaultInstance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  msg3_body_ = const_cast< ::protobuf_sgx_dh_msg3_body_t*>(
+      ::protobuf_sgx_dh_msg3_body_t::internal_default_instance());
+#else
+  msg3_body_ = const_cast< ::protobuf_sgx_dh_msg3_body_t*>(&::protobuf_sgx_dh_msg3_body_t::default_instance());
+#endif
+}
+
+protobuf_sgx_dh_msg3_t::protobuf_sgx_dh_msg3_t(const protobuf_sgx_dh_msg3_t& from)
+  : ::google::protobuf::MessageLite() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_dh_msg3_t)
+}
+
+void protobuf_sgx_dh_msg3_t::SharedCtor() {
+  _cached_size_ = 0;
+  msg3_body_ = NULL;
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_dh_msg3_t::~protobuf_sgx_dh_msg3_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_dh_msg3_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_dh_msg3_t::SharedDtor() {
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  if (this != &default_instance()) {
+  #else
+  if (this != default_instance_) {
+  #endif
+    delete msg3_body_;
+  }
+}
+
+void protobuf_sgx_dh_msg3_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const protobuf_sgx_dh_msg3_t& protobuf_sgx_dh_msg3_t::default_instance() {
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#else
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufLAMessages_2eproto();
+#endif
+  return *default_instance_;
+}
+
+protobuf_sgx_dh_msg3_t* protobuf_sgx_dh_msg3_t::default_instance_ = NULL;
+
+protobuf_sgx_dh_msg3_t* protobuf_sgx_dh_msg3_t::New() const {
+  return new protobuf_sgx_dh_msg3_t;
+}
+
+void protobuf_sgx_dh_msg3_t::Clear() {
+  if (has_msg3_body()) {
+    if (msg3_body_ != NULL) msg3_body_->::protobuf_sgx_dh_msg3_body_t::Clear();
+  }
+  cmac_.Clear();
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->clear();
+}
+
+bool protobuf_sgx_dh_msg3_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  ::google::protobuf::io::StringOutputStream unknown_fields_string(
+      mutable_unknown_fields());
+  ::google::protobuf::io::CodedOutputStream unknown_fields_stream(
+      &unknown_fields_string);
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_dh_msg3_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_msg3_body()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_cmac;
+        break;
+      }
+
+      // repeated uint32 cmac = 2 [packed = true];
+      case 2: {
+        if (tag == 18) {
+         parse_cmac:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, this->mutable_cmac())));
+        } else if (tag == 16) {
+          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 1, 18, input, this->mutable_cmac())));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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:protobuf_sgx_dh_msg3_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_dh_msg3_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_dh_msg3_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_dh_msg3_t)
+  // required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+  if (has_msg3_body()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessage(
+      1, this->msg3_body(), output);
+  }
+
+  // repeated uint32 cmac = 2 [packed = true];
+  if (this->cmac_size() > 0) {
+    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
+    output->WriteVarint32(_cmac_cached_byte_size_);
+  }
+  for (int i = 0; i < this->cmac_size(); i++) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
+      this->cmac(i), output);
+  }
+
+  output->WriteRaw(unknown_fields().data(),
+                   unknown_fields().size());
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_dh_msg3_t)
+}
+
+int protobuf_sgx_dh_msg3_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+    if (has_msg3_body()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->msg3_body());
+    }
+
+  }
+  // repeated uint32 cmac = 2 [packed = true];
+  {
+    int data_size = 0;
+    for (int i = 0; i < this->cmac_size(); i++) {
+      data_size += ::google::protobuf::internal::WireFormatLite::
+        UInt32Size(this->cmac(i));
+    }
+    if (data_size > 0) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
+    }
+    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+    _cmac_cached_byte_size_ = data_size;
+    GOOGLE_SAFE_CONCURRENT_WRITES_END();
+    total_size += data_size;
+  }
+
+  total_size += unknown_fields().size();
+
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_dh_msg3_t::CheckTypeAndMergeFrom(
+    const ::google::protobuf::MessageLite& from) {
+  MergeFrom(*::google::protobuf::down_cast<const protobuf_sgx_dh_msg3_t*>(&from));
+}
+
+void protobuf_sgx_dh_msg3_t::MergeFrom(const protobuf_sgx_dh_msg3_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  cmac_.MergeFrom(from.cmac_);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_msg3_body()) {
+      mutable_msg3_body()->::protobuf_sgx_dh_msg3_body_t::MergeFrom(from.msg3_body());
+    }
+  }
+  mutable_unknown_fields()->append(from.unknown_fields());
+}
+
+void protobuf_sgx_dh_msg3_t::CopyFrom(const protobuf_sgx_dh_msg3_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_dh_msg3_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;
+
+  if (has_msg3_body()) {
+    if (!this->msg3_body().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_sgx_dh_msg3_t::Swap(protobuf_sgx_dh_msg3_t* other) {
+  if (other != this) {
+    std::swap(msg3_body_, other->msg3_body_);
+    cmac_.Swap(&other->cmac_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.swap(other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::std::string protobuf_sgx_dh_msg3_t::GetTypeName() const {
+  return "protobuf_sgx_dh_msg3_t";
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+// @@protoc_insertion_point(global_scope)

+ 729 - 0
ProtobufSealerMessages.cpp

@@ -0,0 +1,729 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ProtobufSealerMessages.proto
+
+#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
+#include "ProtobufSealerMessages.pb.h"
+
+#include <algorithm>
+
+#include <google/protobuf/stubs/common.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/descriptor.h>
+#include <google/protobuf/generated_message_reflection.h>
+#include <google/protobuf/reflection_ops.h>
+#include <google/protobuf/wire_format.h>
+// @@protoc_insertion_point(includes)
+
+namespace {
+
+const ::google::protobuf::Descriptor* protobuf_sgx_mc_uuid_t_descriptor_ = NULL;
+const ::google::protobuf::internal::GeneratedMessageReflection*
+  protobuf_sgx_mc_uuid_t_reflection_ = NULL;
+const ::google::protobuf::Descriptor* protobuf_plaintext_seal_message_descriptor_ = NULL;
+const ::google::protobuf::internal::GeneratedMessageReflection*
+  protobuf_plaintext_seal_message_reflection_ = NULL;
+
+}  // namespace
+
+
+void protobuf_AssignDesc_ProtobufSealerMessages_2eproto() {
+  protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  const ::google::protobuf::FileDescriptor* file =
+    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
+      "ProtobufSealerMessages.proto");
+  GOOGLE_CHECK(file != NULL);
+  protobuf_sgx_mc_uuid_t_descriptor_ = file->message_type(0);
+  static const int protobuf_sgx_mc_uuid_t_offsets_[2] = {
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_sgx_mc_uuid_t, nonce_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_sgx_mc_uuid_t, counter_id_),
+  };
+  protobuf_sgx_mc_uuid_t_reflection_ =
+    new ::google::protobuf::internal::GeneratedMessageReflection(
+      protobuf_sgx_mc_uuid_t_descriptor_,
+      protobuf_sgx_mc_uuid_t::default_instance_,
+      protobuf_sgx_mc_uuid_t_offsets_,
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_sgx_mc_uuid_t, _has_bits_[0]),
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_sgx_mc_uuid_t, _unknown_fields_),
+      -1,
+      ::google::protobuf::DescriptorPool::generated_pool(),
+      ::google::protobuf::MessageFactory::generated_factory(),
+      sizeof(protobuf_sgx_mc_uuid_t));
+  protobuf_plaintext_seal_message_descriptor_ = file->message_type(1);
+  static const int protobuf_plaintext_seal_message_offsets_[3] = {
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_plaintext_seal_message, monotonic_counter_id_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_plaintext_seal_message, monotonic_counter_value_),
+    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_plaintext_seal_message, message_),
+  };
+  protobuf_plaintext_seal_message_reflection_ =
+    new ::google::protobuf::internal::GeneratedMessageReflection(
+      protobuf_plaintext_seal_message_descriptor_,
+      protobuf_plaintext_seal_message::default_instance_,
+      protobuf_plaintext_seal_message_offsets_,
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_plaintext_seal_message, _has_bits_[0]),
+      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(protobuf_plaintext_seal_message, _unknown_fields_),
+      -1,
+      ::google::protobuf::DescriptorPool::generated_pool(),
+      ::google::protobuf::MessageFactory::generated_factory(),
+      sizeof(protobuf_plaintext_seal_message));
+}
+
+namespace {
+
+GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
+inline void protobuf_AssignDescriptorsOnce() {
+  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
+                 &protobuf_AssignDesc_ProtobufSealerMessages_2eproto);
+}
+
+void protobuf_RegisterTypes(const ::std::string&) {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
+    protobuf_sgx_mc_uuid_t_descriptor_, &protobuf_sgx_mc_uuid_t::default_instance());
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
+    protobuf_plaintext_seal_message_descriptor_, &protobuf_plaintext_seal_message::default_instance());
+}
+
+}  // namespace
+
+void protobuf_ShutdownFile_ProtobufSealerMessages_2eproto() {
+  delete protobuf_sgx_mc_uuid_t::default_instance_;
+  delete protobuf_sgx_mc_uuid_t_reflection_;
+  delete protobuf_plaintext_seal_message::default_instance_;
+  delete protobuf_plaintext_seal_message_reflection_;
+}
+
+void protobuf_AddDesc_ProtobufSealerMessages_2eproto() {
+  static bool already_here = false;
+  if (already_here) return;
+  already_here = true;
+  GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
+    "\n\034ProtobufSealerMessages.proto\";\n\026protob"
+    "uf_sgx_mc_uuid_t\022\r\n\005nonce\030\001 \002(\014\022\022\n\ncount"
+    "er_id\030\002 \002(\014\"\212\001\n\037protobuf_plaintext_seal_"
+    "message\0225\n\024monotonic_counter_id\030\001 \002(\0132\027."
+    "protobuf_sgx_mc_uuid_t\022\037\n\027monotonic_coun"
+    "ter_value\030\002 \002(\r\022\017\n\007message\030\003 \002(\014", 232);
+  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
+    "ProtobufSealerMessages.proto", &protobuf_RegisterTypes);
+  protobuf_sgx_mc_uuid_t::default_instance_ = new protobuf_sgx_mc_uuid_t();
+  protobuf_plaintext_seal_message::default_instance_ = new protobuf_plaintext_seal_message();
+  protobuf_sgx_mc_uuid_t::default_instance_->InitAsDefaultInstance();
+  protobuf_plaintext_seal_message::default_instance_->InitAsDefaultInstance();
+  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ProtobufSealerMessages_2eproto);
+}
+
+// Force AddDescriptors() to be called at static initialization time.
+struct StaticDescriptorInitializer_ProtobufSealerMessages_2eproto {
+  StaticDescriptorInitializer_ProtobufSealerMessages_2eproto() {
+    protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  }
+} static_descriptor_initializer_ProtobufSealerMessages_2eproto_;
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_sgx_mc_uuid_t::kNonceFieldNumber;
+const int protobuf_sgx_mc_uuid_t::kCounterIdFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_sgx_mc_uuid_t::protobuf_sgx_mc_uuid_t()
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_sgx_mc_uuid_t)
+}
+
+void protobuf_sgx_mc_uuid_t::InitAsDefaultInstance() {
+}
+
+protobuf_sgx_mc_uuid_t::protobuf_sgx_mc_uuid_t(const protobuf_sgx_mc_uuid_t& from)
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_sgx_mc_uuid_t)
+}
+
+void protobuf_sgx_mc_uuid_t::SharedCtor() {
+  ::google::protobuf::internal::GetEmptyString();
+  _cached_size_ = 0;
+  nonce_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  counter_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_sgx_mc_uuid_t::~protobuf_sgx_mc_uuid_t() {
+  // @@protoc_insertion_point(destructor:protobuf_sgx_mc_uuid_t)
+  SharedDtor();
+}
+
+void protobuf_sgx_mc_uuid_t::SharedDtor() {
+  if (nonce_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete nonce_;
+  }
+  if (counter_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete counter_id_;
+  }
+  if (this != default_instance_) {
+  }
+}
+
+void protobuf_sgx_mc_uuid_t::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* protobuf_sgx_mc_uuid_t::descriptor() {
+  protobuf_AssignDescriptorsOnce();
+  return protobuf_sgx_mc_uuid_t_descriptor_;
+}
+
+const protobuf_sgx_mc_uuid_t& protobuf_sgx_mc_uuid_t::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  return *default_instance_;
+}
+
+protobuf_sgx_mc_uuid_t* protobuf_sgx_mc_uuid_t::default_instance_ = NULL;
+
+protobuf_sgx_mc_uuid_t* protobuf_sgx_mc_uuid_t::New() const {
+  return new protobuf_sgx_mc_uuid_t;
+}
+
+void protobuf_sgx_mc_uuid_t::Clear() {
+  if (_has_bits_[0 / 32] & 3) {
+    if (has_nonce()) {
+      if (nonce_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+        nonce_->clear();
+      }
+    }
+    if (has_counter_id()) {
+      if (counter_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+        counter_id_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->Clear();
+}
+
+bool protobuf_sgx_mc_uuid_t::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:protobuf_sgx_mc_uuid_t)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required bytes nonce = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_nonce()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(18)) goto parse_counter_id;
+        break;
+      }
+
+      // required bytes counter_id = 2;
+      case 2: {
+        if (tag == 18) {
+         parse_counter_id:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_counter_id()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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::WireFormat::SkipField(
+              input, tag, mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:protobuf_sgx_mc_uuid_t)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_sgx_mc_uuid_t)
+  return false;
+#undef DO_
+}
+
+void protobuf_sgx_mc_uuid_t::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_sgx_mc_uuid_t)
+  // required bytes nonce = 1;
+  if (has_nonce()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
+      1, this->nonce(), output);
+  }
+
+  // required bytes counter_id = 2;
+  if (has_counter_id()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
+      2, this->counter_id(), output);
+  }
+
+  if (!unknown_fields().empty()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:protobuf_sgx_mc_uuid_t)
+}
+
+::google::protobuf::uint8* protobuf_sgx_mc_uuid_t::SerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // @@protoc_insertion_point(serialize_to_array_start:protobuf_sgx_mc_uuid_t)
+  // required bytes nonce = 1;
+  if (has_nonce()) {
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
+        1, this->nonce(), target);
+  }
+
+  // required bytes counter_id = 2;
+  if (has_counter_id()) {
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
+        2, this->counter_id(), target);
+  }
+
+  if (!unknown_fields().empty()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:protobuf_sgx_mc_uuid_t)
+  return target;
+}
+
+int protobuf_sgx_mc_uuid_t::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required bytes nonce = 1;
+    if (has_nonce()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::BytesSize(
+          this->nonce());
+    }
+
+    // required bytes counter_id = 2;
+    if (has_counter_id()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::BytesSize(
+          this->counter_id());
+    }
+
+  }
+  if (!unknown_fields().empty()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        unknown_fields());
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_sgx_mc_uuid_t::MergeFrom(const ::google::protobuf::Message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  const protobuf_sgx_mc_uuid_t* source =
+    ::google::protobuf::internal::dynamic_cast_if_available<const protobuf_sgx_mc_uuid_t*>(
+      &from);
+  if (source == NULL) {
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+    MergeFrom(*source);
+  }
+}
+
+void protobuf_sgx_mc_uuid_t::MergeFrom(const protobuf_sgx_mc_uuid_t& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_nonce()) {
+      set_nonce(from.nonce());
+    }
+    if (from.has_counter_id()) {
+      set_counter_id(from.counter_id());
+    }
+  }
+  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
+}
+
+void protobuf_sgx_mc_uuid_t::CopyFrom(const ::google::protobuf::Message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void protobuf_sgx_mc_uuid_t::CopyFrom(const protobuf_sgx_mc_uuid_t& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_sgx_mc_uuid_t::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;
+
+  return true;
+}
+
+void protobuf_sgx_mc_uuid_t::Swap(protobuf_sgx_mc_uuid_t* other) {
+  if (other != this) {
+    std::swap(nonce_, other->nonce_);
+    std::swap(counter_id_, other->counter_id_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.Swap(&other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::google::protobuf::Metadata protobuf_sgx_mc_uuid_t::GetMetadata() const {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::Metadata metadata;
+  metadata.descriptor = protobuf_sgx_mc_uuid_t_descriptor_;
+  metadata.reflection = protobuf_sgx_mc_uuid_t_reflection_;
+  return metadata;
+}
+
+
+// ===================================================================
+
+#ifndef _MSC_VER
+const int protobuf_plaintext_seal_message::kMonotonicCounterIdFieldNumber;
+const int protobuf_plaintext_seal_message::kMonotonicCounterValueFieldNumber;
+const int protobuf_plaintext_seal_message::kMessageFieldNumber;
+#endif  // !_MSC_VER
+
+protobuf_plaintext_seal_message::protobuf_plaintext_seal_message()
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  // @@protoc_insertion_point(constructor:protobuf_plaintext_seal_message)
+}
+
+void protobuf_plaintext_seal_message::InitAsDefaultInstance() {
+  monotonic_counter_id_ = const_cast< ::protobuf_sgx_mc_uuid_t*>(&::protobuf_sgx_mc_uuid_t::default_instance());
+}
+
+protobuf_plaintext_seal_message::protobuf_plaintext_seal_message(const protobuf_plaintext_seal_message& from)
+  : ::google::protobuf::Message() {
+  SharedCtor();
+  MergeFrom(from);
+  // @@protoc_insertion_point(copy_constructor:protobuf_plaintext_seal_message)
+}
+
+void protobuf_plaintext_seal_message::SharedCtor() {
+  ::google::protobuf::internal::GetEmptyString();
+  _cached_size_ = 0;
+  monotonic_counter_id_ = NULL;
+  monotonic_counter_value_ = 0u;
+  message_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+}
+
+protobuf_plaintext_seal_message::~protobuf_plaintext_seal_message() {
+  // @@protoc_insertion_point(destructor:protobuf_plaintext_seal_message)
+  SharedDtor();
+}
+
+void protobuf_plaintext_seal_message::SharedDtor() {
+  if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete message_;
+  }
+  if (this != default_instance_) {
+    delete monotonic_counter_id_;
+  }
+}
+
+void protobuf_plaintext_seal_message::SetCachedSize(int size) const {
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+}
+const ::google::protobuf::Descriptor* protobuf_plaintext_seal_message::descriptor() {
+  protobuf_AssignDescriptorsOnce();
+  return protobuf_plaintext_seal_message_descriptor_;
+}
+
+const protobuf_plaintext_seal_message& protobuf_plaintext_seal_message::default_instance() {
+  if (default_instance_ == NULL) protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  return *default_instance_;
+}
+
+protobuf_plaintext_seal_message* protobuf_plaintext_seal_message::default_instance_ = NULL;
+
+protobuf_plaintext_seal_message* protobuf_plaintext_seal_message::New() const {
+  return new protobuf_plaintext_seal_message;
+}
+
+void protobuf_plaintext_seal_message::Clear() {
+  if (_has_bits_[0 / 32] & 7) {
+    if (has_monotonic_counter_id()) {
+      if (monotonic_counter_id_ != NULL) monotonic_counter_id_->::protobuf_sgx_mc_uuid_t::Clear();
+    }
+    monotonic_counter_value_ = 0u;
+    if (has_message()) {
+      if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+        message_->clear();
+      }
+    }
+  }
+  ::memset(_has_bits_, 0, sizeof(_has_bits_));
+  mutable_unknown_fields()->Clear();
+}
+
+bool protobuf_plaintext_seal_message::MergePartialFromCodedStream(
+    ::google::protobuf::io::CodedInputStream* input) {
+#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
+  ::google::protobuf::uint32 tag;
+  // @@protoc_insertion_point(parse_start:protobuf_plaintext_seal_message)
+  for (;;) {
+    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
+    tag = p.first;
+    if (!p.second) goto handle_unusual;
+    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
+      // required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+      case 1: {
+        if (tag == 10) {
+          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
+               input, mutable_monotonic_counter_id()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(16)) goto parse_monotonic_counter_value;
+        break;
+      }
+
+      // required uint32 monotonic_counter_value = 2;
+      case 2: {
+        if (tag == 16) {
+         parse_monotonic_counter_value:
+          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
+                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
+                 input, &monotonic_counter_value_)));
+          set_has_monotonic_counter_value();
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectTag(26)) goto parse_message;
+        break;
+      }
+
+      // required bytes message = 3;
+      case 3: {
+        if (tag == 26) {
+         parse_message:
+          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
+                input, this->mutable_message()));
+        } else {
+          goto handle_unusual;
+        }
+        if (input->ExpectAtEnd()) goto success;
+        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::WireFormat::SkipField(
+              input, tag, mutable_unknown_fields()));
+        break;
+      }
+    }
+  }
+success:
+  // @@protoc_insertion_point(parse_success:protobuf_plaintext_seal_message)
+  return true;
+failure:
+  // @@protoc_insertion_point(parse_failure:protobuf_plaintext_seal_message)
+  return false;
+#undef DO_
+}
+
+void protobuf_plaintext_seal_message::SerializeWithCachedSizes(
+    ::google::protobuf::io::CodedOutputStream* output) const {
+  // @@protoc_insertion_point(serialize_start:protobuf_plaintext_seal_message)
+  // required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+  if (has_monotonic_counter_id()) {
+    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
+      1, this->monotonic_counter_id(), output);
+  }
+
+  // required uint32 monotonic_counter_value = 2;
+  if (has_monotonic_counter_value()) {
+    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->monotonic_counter_value(), output);
+  }
+
+  // required bytes message = 3;
+  if (has_message()) {
+    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
+      3, this->message(), output);
+  }
+
+  if (!unknown_fields().empty()) {
+    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
+        unknown_fields(), output);
+  }
+  // @@protoc_insertion_point(serialize_end:protobuf_plaintext_seal_message)
+}
+
+::google::protobuf::uint8* protobuf_plaintext_seal_message::SerializeWithCachedSizesToArray(
+    ::google::protobuf::uint8* target) const {
+  // @@protoc_insertion_point(serialize_to_array_start:protobuf_plaintext_seal_message)
+  // required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+  if (has_monotonic_counter_id()) {
+    target = ::google::protobuf::internal::WireFormatLite::
+      WriteMessageNoVirtualToArray(
+        1, this->monotonic_counter_id(), target);
+  }
+
+  // required uint32 monotonic_counter_value = 2;
+  if (has_monotonic_counter_value()) {
+    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->monotonic_counter_value(), target);
+  }
+
+  // required bytes message = 3;
+  if (has_message()) {
+    target =
+      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
+        3, this->message(), target);
+  }
+
+  if (!unknown_fields().empty()) {
+    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
+        unknown_fields(), target);
+  }
+  // @@protoc_insertion_point(serialize_to_array_end:protobuf_plaintext_seal_message)
+  return target;
+}
+
+int protobuf_plaintext_seal_message::ByteSize() const {
+  int total_size = 0;
+
+  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    // required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+    if (has_monotonic_counter_id()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
+          this->monotonic_counter_id());
+    }
+
+    // required uint32 monotonic_counter_value = 2;
+    if (has_monotonic_counter_value()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::UInt32Size(
+          this->monotonic_counter_value());
+    }
+
+    // required bytes message = 3;
+    if (has_message()) {
+      total_size += 1 +
+        ::google::protobuf::internal::WireFormatLite::BytesSize(
+          this->message());
+    }
+
+  }
+  if (!unknown_fields().empty()) {
+    total_size +=
+      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
+        unknown_fields());
+  }
+  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
+  _cached_size_ = total_size;
+  GOOGLE_SAFE_CONCURRENT_WRITES_END();
+  return total_size;
+}
+
+void protobuf_plaintext_seal_message::MergeFrom(const ::google::protobuf::Message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  const protobuf_plaintext_seal_message* source =
+    ::google::protobuf::internal::dynamic_cast_if_available<const protobuf_plaintext_seal_message*>(
+      &from);
+  if (source == NULL) {
+    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
+  } else {
+    MergeFrom(*source);
+  }
+}
+
+void protobuf_plaintext_seal_message::MergeFrom(const protobuf_plaintext_seal_message& from) {
+  GOOGLE_CHECK_NE(&from, this);
+  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
+    if (from.has_monotonic_counter_id()) {
+      mutable_monotonic_counter_id()->::protobuf_sgx_mc_uuid_t::MergeFrom(from.monotonic_counter_id());
+    }
+    if (from.has_monotonic_counter_value()) {
+      set_monotonic_counter_value(from.monotonic_counter_value());
+    }
+    if (from.has_message()) {
+      set_message(from.message());
+    }
+  }
+  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
+}
+
+void protobuf_plaintext_seal_message::CopyFrom(const ::google::protobuf::Message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+void protobuf_plaintext_seal_message::CopyFrom(const protobuf_plaintext_seal_message& from) {
+  if (&from == this) return;
+  Clear();
+  MergeFrom(from);
+}
+
+bool protobuf_plaintext_seal_message::IsInitialized() const {
+  if ((_has_bits_[0] & 0x00000007) != 0x00000007) return false;
+
+  if (has_monotonic_counter_id()) {
+    if (!this->monotonic_counter_id().IsInitialized()) return false;
+  }
+  return true;
+}
+
+void protobuf_plaintext_seal_message::Swap(protobuf_plaintext_seal_message* other) {
+  if (other != this) {
+    std::swap(monotonic_counter_id_, other->monotonic_counter_id_);
+    std::swap(monotonic_counter_value_, other->monotonic_counter_value_);
+    std::swap(message_, other->message_);
+    std::swap(_has_bits_[0], other->_has_bits_[0]);
+    _unknown_fields_.Swap(&other->_unknown_fields_);
+    std::swap(_cached_size_, other->_cached_size_);
+  }
+}
+
+::google::protobuf::Metadata protobuf_plaintext_seal_message::GetMetadata() const {
+  protobuf_AssignDescriptorsOnce();
+  ::google::protobuf::Metadata metadata;
+  metadata.descriptor = protobuf_plaintext_seal_message_descriptor_;
+  metadata.reflection = protobuf_plaintext_seal_message_reflection_;
+  return metadata;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+// @@protoc_insertion_point(global_scope)

+ 19 - 0
SgxCrypto.cpp

@@ -0,0 +1,19 @@
+#include "stdlib.h"
+//#include "string"
+#include "sgx_tcrypto.h"
+int create_rsa_key_pair_for_signing_manifest(/*std::string& priv_key, std::string& pub_key*/) 
+{
+	uint32_t ret_sgx;
+	uint8_t* n=(uint8_t*)malloc(384); 
+        uint8_t* d=(uint8_t*)malloc(384); 
+        uint8_t* p=(uint8_t*)malloc(192); 
+        uint8_t* q=(uint8_t*)malloc(192); 
+        uint8_t* dmp1=(uint8_t*)malloc(192); 
+        uint8_t* dmq1=(uint8_t*)malloc(192); 
+        uint8_t* iqmp=(uint8_t*)malloc(192); 
+	uint8_t e[4];
+
+	ret_sgx=sgx_create_rsa_key_pair(384, 4, n, d, e, p, q, dmp1, dmq1, iqmp);
+	free(n); free(d); free(p); free(q); free(dmp1); free(dmq1); free(iqmp);
+	return ret_sgx;
+}

+ 136 - 0
SgxLAInitiator.cpp

@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#include "sgx_trts.h"
+#include "sgx_utils.h"
+#include "sgx_eid.h"
+#include "error_codes.h"
+#include "sgx_ecp_types.h"
+#include "sgx_thread.h"
+#include <map>
+#include "sgx_dh.h"
+#include "dh_session_protocol.h"
+#include "sgx_tcrypto.h"
+#include "datatypes.h"
+#include "ProtobufSgxLATransforms_Inititator.h"
+#define MAX_SESSION_COUNT  16
+#define SGX_CAST(type, item) ((type)(item))
+#include <string.h>
+
+// uint32_t session_ids[MAX_SESSION_COUNT] ;
+
+// Our enclave will not be doing LA with more than 1 decryptor enclave at a time.
+// We should not need this.
+//std::map<int, dh_session_t>g_dest_session_info_map;
+dh_session_t global_session_info;
+// TODO: May be we need to store all previously assigned session IDs instead of just the counter; to prevent replay attacks -
+uint32_t global_session_id=0;
+
+uint32_t verify_peer_enclave_trust(sgx_dh_session_enclave_identity_t* peer_enclave_identity, uint8_t* expected_mr_enclave, uint8_t* expected_mr_signer)
+{
+  int count=0;
+  if(!peer_enclave_identity)
+    return INVALID_PARAMETER_ERROR;
+
+  sgx_measurement_t actual_mr_enclave = peer_enclave_identity->mr_enclave;
+  sgx_measurement_t actual_mr_signer = peer_enclave_identity->mr_signer;
+/*  for(count=0; count<SGX_HASH_SIZE; count++)
+  {
+    if( actual_mr_enclave.m[count] != expected_mr_enclave[count] )
+    {
+        return ENCLAVE_TRUST_ERROR;
+    }
+    if( actual_mr_signer.m[count] != expected_mr_signer[count] )
+    {
+        return ENCLAVE_TRUST_ERROR; // TODO: Different error here.
+    }
+  }*/
+  return SUCCESS;
+}
+
+
+//Create a session with the destination enclave
+int create_session(int fd, uint8_t* expected_mr_enclave, uint8_t* expected_mr_signer, uint8_t* send_mr_signer)
+{
+  sgx_dh_msg1_t dh_msg1;            //Diffie-Hellman Message 1
+  sgx_key_128bit_t dh_aek;        // Session Key
+  sgx_dh_msg2_t dh_msg2;            //Diffie-Hellman Message 2
+  sgx_dh_msg3_t dh_msg3;            //Diffie-Hellman Message 3
+
+  int retstatus;
+  sgx_status_t status = SGX_SUCCESS;
+  sgx_dh_session_t sgx_dh_session;
+  sgx_dh_session_enclave_identity_t responder_identity;
+
+  memset(&dh_aek,0, sizeof(sgx_key_128bit_t));
+  memset(&dh_msg1, 0, sizeof(sgx_dh_msg1_t));
+  memset(&dh_msg2, 0, sizeof(sgx_dh_msg2_t));
+  memset(&dh_msg3, 0, sizeof(sgx_dh_msg3_t));
+  memset(&global_session_info, 0, sizeof(dh_session_t));
+
+  //Intialize the session as a session initiator
+  status = sgx_dh_init_session(SGX_DH_SESSION_INITIATOR, &sgx_dh_session);
+  if(status != SGX_SUCCESS)
+    return status;
+
+  retstatus = session_request_call(fd, &dh_msg1);//, &session_id);
+  if(retstatus!=0)
+    return retstatus;
+
+  //Process the message 1 obtained from desination enclave and generate message 2
+  status = sgx_dh_initiator_proc_msg1(&dh_msg1, &dh_msg2, &sgx_dh_session);
+  if(SGX_SUCCESS != status)
+    return status;
+
+  //Send Message 2 to Destination Enclave and get Message 3 in return
+  retstatus = exchange_report_call( fd, &dh_msg2, &dh_msg3); //, &session_id);
+  if(retstatus!=0)
+	 return retstatus;
+
+  //Process Message 3 obtained from the destination enclave
+  status = sgx_dh_initiator_proc_msg3(&dh_msg3, &sgx_dh_session, &dh_aek, &responder_identity);
+  if(SGX_SUCCESS != status)
+    return status;
+
+  // Verify the identity of the destination enclave
+  retstatus = verify_peer_enclave_trust(&responder_identity, expected_mr_enclave, expected_mr_signer);
+  if(retstatus != 0)
+    return retstatus;
+
+  memcpy(global_session_info.active.AEK, &dh_aek, sizeof(sgx_key_128bit_t));
+  global_session_info.session_id = 1; // TODO: session_id;
+  global_session_info.active.counter = 0;
+  global_session_info.status = ACTIVE;
+  memset(&dh_aek,0, sizeof(sgx_key_128bit_t));
+
+  return 0;
+}

+ 489 - 0
SgxProtobufLATransforms_Inititator.cpp

@@ -0,0 +1,489 @@
+#include "sgx_eid.h"
+#include "error_codes.h"
+#include "datatypes.h"
+#include "sgx_urts.h"
+#include "sgx_dh.h"
+
+// For msg1
+#define SGX_TARGET_INFO_RESERVED1_BYTES 4
+#define SGX_TARGET_INFO_RESERVED2_BYTES 456
+#define SGX_ECP256_KEY_SIZE 32
+#define SGX_HASH_SIZE 32 /* SHA256 */
+// For msg2
+#define SGX_REPORT_DATA_SIZE 64
+#define SGX_KEYID_SIZE 32
+#define SGX_DH_MAC_SIZE 16
+#define SGX_REPORT_BODY_RESERVED1 28
+#define SGX_REPORT_BODY_RESERVED2 32
+#define SGX_REPORT_BODY_RESERVED3 96
+#define SGX_REPORT_BODY_RESERVED4 60
+
+
+#include <stdio.h>
+// For google protobufs and deserialization/serialization
+#include "ProtobufLAMessages.h"
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl.h>
+using namespace google::protobuf::io;
+#include <inttypes.h>
+
+int fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8)
+{
+ if(temp32 > UINT8_MAX)
+	 return -1;
+ else
+ {
+	 //		 *temp8 = *(uint8_t*)&temp32; // Probably works irrespective of endianness but not sure.
+	 *temp8 = (uint8_t)temp32;
+	 return 0;
+ }
+}
+
+int fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16)
+{
+ if(temp32 > UINT16_MAX)
+         return -1;
+ else
+ {
+         //              *temp8 = *(uint8_t*)&temp32; // Probably works irrespective of endianness but not sure.
+         *temp16 = (uint16_t)temp32;
+         return 0;
+ }
+}
+
+int read_protobuf_msg_from_fd(int accept_fd, google::protobuf::MessageLite& message)
+{
+  ZeroCopyInputStream* raw_input;
+  CodedInputStream* coded_input;
+  uint32_t size;
+  CodedInputStream::Limit limit;
+  raw_input = new FileInputStream(accept_fd);
+  coded_input = new CodedInputStream(raw_input);
+  if(!coded_input->ReadVarint32(&size))
+  {
+    printf("Error in reading size of msg");
+    fflush(stdout);
+    return -1;
+  }
+  //printf("size of msg was read to be %" PRIu32 " \n", size);
+  //fflush(stdout);
+  limit = coded_input->PushLimit(size);
+  if(!message.ParseFromCodedStream(coded_input))
+  {
+    printf("Error in parsing msg");
+    fflush(stdout);
+  coded_input->PopLimit(limit);
+
+    return -1;
+  }
+  coded_input->PopLimit(limit);
+  return 0;
+}
+
+int write_protobuf_msg_to_fd(int accept_fd, google::protobuf::MessageLite& message)
+{
+  ZeroCopyOutputStream* raw_output = new FileOutputStream(accept_fd);
+  CodedOutputStream* coded_output = new CodedOutputStream(raw_output);
+  coded_output->WriteVarint32(message.ByteSize());
+  if(!message.SerializeToCodedStream(coded_output))
+  {
+    printf("SerializeToCodedStream failed");
+    fflush(stdout);
+    return -1;
+  }
+  // As per this - https://stackoverflow.com/questions/22881876/protocol-buffers-how-to-serialize-and-deserialize-multiple-messages-into-a-file?noredirect=1&lq=1
+  // TODO: There may be a better way to do this - 1) this happens with every accept now and 2) make it happen on the stack vs heap - destructor will be called on return from this function (main) and the items will then be written out. (We probably don't want that, actually)
+  delete coded_output;
+  delete raw_output;
+  fflush(stdout);
+  return 0;
+}
+
+void encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a)
+{
+	printf("\n ec256 public key gx and gy \n");
+	int counter; google::protobuf::uint32 temp32;
+	for(counter=0;counter<SGX_ECP256_KEY_SIZE;counter++)
+	{
+		temp32 = g_a->gx[counter];
+		protobuf_g_a->add_gx(temp32);
+		printf("%d ", temp32);
+		temp32 = g_a->gy[counter];
+		protobuf_g_a->add_gy(temp32);
+		printf("%d ", temp32);
+	}
+	printf("\n");
+}
+
+void encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
+{
+	protobuf_attributes->set_flags(attributes->flags); // 64 bit
+	protobuf_attributes->set_xfrm(attributes->xfrm); // 64 bit
+}
+
+void encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
+{
+	printf("\n report \n key id \n");
+	int counter; google::protobuf::uint32 temp32;
+	for(counter=0;counter<SGX_KEYID_SIZE;counter++)
+	{
+		temp32=report->key_id.id[counter];
+		protobuf_report->add_key_id(temp32);
+		printf("%d ",temp32);
+	}
+
+	printf("\n mac \n");
+	for(counter=0;counter<SGX_MAC_SIZE;counter++)
+	{
+		temp32=report->mac[counter];
+		protobuf_report->add_mac(temp32);
+		printf("%d ", temp32);
+	}
+
+	protobuf_report->mutable_body()->set_misc_select(report->body.misc_select); // 32 bit
+	protobuf_report->mutable_body()->set_isv_svn(report->body.isv_svn); // 16 bit
+	protobuf_report->mutable_body()->set_isv_prod_id(report->body.isv_prod_id); // 16 bit
+	encode_attributes_to_protobuf(protobuf_report->mutable_body()->mutable_attributes(), &(report->body.attributes));
+
+	for(counter=0;counter<SGX_CPUSVN_SIZE;counter++)
+	{
+		temp32=report->body.cpu_svn.svn[counter];
+		protobuf_report->mutable_body()->add_cpu_svn(temp32);
+	}
+
+	for(counter=0;counter<SGX_REPORT_BODY_RESERVED1;counter++)
+	{
+		temp32=report->body.reserved1[counter]; // TODO: Could be optimized out - if these are determined to be 0s.
+		protobuf_report->mutable_body()->add_reserved1(temp32);
+ 	}
+
+	for(counter=0;counter<SGX_REPORT_BODY_RESERVED2;counter++)
+	{
+		temp32=report->body.reserved2[counter]; // TODO: Could be optimized out - if these are determined to be 0s.
+		protobuf_report->mutable_body()->add_reserved2(temp32);
+	}
+
+	for(counter=0;counter<SGX_REPORT_BODY_RESERVED3;counter++)
+	{
+		temp32=report->body.reserved3[counter]; // TODO: Could be optimized out - if these are determined to be 0s.
+		protobuf_report->mutable_body()->add_reserved3(temp32);
+ 	}
+
+	for(counter=0;counter<SGX_REPORT_BODY_RESERVED4;counter++)
+	{
+		temp32=report->body.reserved4[counter]; // TODO: Could be optimized out - if these are determined to be 0s.
+		protobuf_report->mutable_body()->add_reserved4(temp32);
+ 	}
+
+	printf("\nmr enclave\n"); 
+	fflush(stdout);
+	for(counter=0;counter<SGX_HASH_SIZE;counter++)
+	{
+		temp32=report->body.mr_enclave.m[counter];
+		protobuf_report->mutable_body()->add_mr_enclave(temp32);
+		printf("%x ", temp32); 
+ 	}
+	
+	printf("\n mr signer\n");  fflush(stdout); 
+	for(counter=0;counter<SGX_HASH_SIZE;counter++)
+	{
+		temp32=report->body.mr_signer.m[counter];
+		protobuf_report->mutable_body()->add_mr_signer(temp32);
+		printf("%x ", temp32); 
+ 	}
+	
+
+	for(counter=0;counter<SGX_REPORT_DATA_SIZE;counter++)
+	{
+		temp32=report->body.report_data.d[counter];
+		protobuf_report->mutable_body()->add_report_data(temp32);
+ 	}
+}
+
+int decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
+{
+        attributes->flags = protobuf_attributes->flags();
+  printf("\n flags %" PRIu64 " \n", attributes->flags);
+        attributes->xfrm = protobuf_attributes->xfrm();
+  printf("\n xfrm %" PRIu64 " \n", attributes->xfrm);
+        return 0;
+}
+
+int decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
+{
+  int counter; google::protobuf::uint32 temp32;
+  printf("\n----------------------Decoding received msg3 ------------------------\n");
+  printf("\nreport body keyid\n");
+  for(counter=0;counter<SGX_KEYID_SIZE;counter++)
+  {
+    temp32=protobuf_report->key_id(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->key_id.id[counter]))!=0)
+		  return -1;
+    printf("%d ", report->key_id.id[counter]);
+  }
+
+  printf("\nreport mac\n");
+  for(counter=0;counter<SGX_MAC_SIZE;counter++)
+  {
+    temp32=protobuf_report->mac(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->mac[counter]))!=0)
+      return -1;
+    printf("%d ", report->mac[counter]);
+  }
+
+  report->body.misc_select=protobuf_report->mutable_body()->misc_select(); // 32 bit
+  temp32=protobuf_report->mutable_body()->isv_svn();
+  if(fit_32_into_uint16_t(temp32, &(report->body.isv_svn))!=0)
+   return -1;
+  printf("\nmisc select %d \n", report->body.misc_select);
+
+  temp32=protobuf_report->mutable_body()->isv_prod_id();
+   if(fit_32_into_uint16_t(temp32, &(report->body.isv_prod_id))!=0)
+    return -1;
+  printf("\nprod id %d \n", report->body.isv_prod_id);
+
+  decode_attributes_from_protobuf(protobuf_report->mutable_body()->mutable_attributes(), &(report->body.attributes));
+
+  printf("\n cpu svn\n");
+  for(counter=0;counter<SGX_CPUSVN_SIZE;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->cpu_svn(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.cpu_svn.svn[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.cpu_svn.svn[counter]);
+
+  }
+
+  printf("\n reserved1 \n");
+  for(counter=0;counter<SGX_REPORT_BODY_RESERVED1;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->reserved1(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.reserved1[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.reserved1[counter]);
+  }
+
+  printf("\n reserved2 \n");
+  for(counter=0;counter<SGX_REPORT_BODY_RESERVED2;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->reserved2(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.reserved2[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.reserved2[counter]);
+  }
+
+  printf("\n reserved3 \n");
+  for(counter=0;counter<SGX_REPORT_BODY_RESERVED3;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->reserved3(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.reserved3[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.reserved3[counter]);
+  }
+
+  printf("\n reserved4 \n");
+  for(counter=0;counter<SGX_REPORT_BODY_RESERVED4;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->reserved4(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.reserved4[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.reserved4[counter]);
+
+  }
+
+  printf("\n mrenclave \n");
+  for(counter=0;counter<SGX_HASH_SIZE;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->mr_enclave(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.mr_enclave.m[counter]))!=0)
+      return -1;
+    printf("%x ", report->body.mr_enclave.m[counter]);
+  }
+
+  printf("\n mrsigner \n");
+  for(counter=0;counter<SGX_HASH_SIZE;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->mr_signer(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.mr_signer.m[counter]))!=0)
+      return -1;
+    printf("%x ", report->body.mr_signer.m[counter]);
+  }
+
+  printf("\n report data\n");
+  for(counter=0;counter<SGX_REPORT_DATA_SIZE;counter++)
+  {
+    temp32=protobuf_report->mutable_body()->report_data(counter);
+    if(fit_32_into_uint8_t(temp32, &(report->body.report_data.d[counter]))!=0)
+      return -1;
+    printf("%d ", report->body.report_data.d[counter]);
+  }
+  printf("\n------------------------ end of msg3 --------------------------\n"); 
+	return 0;
+}
+
+int decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1)
+{
+	int counter; google::protobuf::uint32 temp32;// google::protobuf::uint64 temp64;
+
+	for(counter=0;counter<SGX_ECP256_KEY_SIZE;counter++)
+	{
+		temp32 = protobuf_dhmsg1.mutable_g_a()->gx(counter);
+		if(fit_32_into_uint8_t(temp32, &(native_dhmsg1->g_a.gx[counter]))!=0)
+		 return -1;
+		temp32 = protobuf_dhmsg1.mutable_g_a()->gy(counter);
+		if(fit_32_into_uint8_t(temp32, &(native_dhmsg1->g_a.gy[counter]))!=0)
+		 return -1;
+	}
+
+	for(counter=0;counter<SGX_HASH_SIZE;counter++)
+	{
+		temp32 = protobuf_dhmsg1.mutable_target()->mr_enclave(counter);
+		if(fit_32_into_uint8_t(temp32, &(native_dhmsg1->target.mr_enclave.m[counter]))!=0)
+		 return -1;
+	}
+
+	for(counter=0;counter<SGX_TARGET_INFO_RESERVED1_BYTES;counter++)
+	{
+		temp32 = protobuf_dhmsg1.mutable_target()->reserved1(counter);
+		if(fit_32_into_uint8_t(temp32, &(native_dhmsg1->target.reserved1[counter]))!=0)
+		 return -1;
+	}
+
+	for(counter=0;counter<SGX_TARGET_INFO_RESERVED2_BYTES;counter++)
+	{
+		temp32 = protobuf_dhmsg1.mutable_target()->reserved2(counter);
+		if(fit_32_into_uint8_t(temp32, &(native_dhmsg1->target.reserved2[counter]))!=0)
+		 return -1;
+	}
+
+	native_dhmsg1->target.attributes.flags = protobuf_dhmsg1.mutable_target()->mutable_attributes()->flags();
+	native_dhmsg1->target.attributes.xfrm = protobuf_dhmsg1.mutable_target()->mutable_attributes()->xfrm();
+	native_dhmsg1->target.misc_select = protobuf_dhmsg1.mutable_target()->misc_select();
+	return 0;
+}
+
+int decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3)
+{
+  int counter; google::protobuf::uint32 temp32;
+  for(counter=0;counter<SGX_DH_MAC_SIZE;counter++)
+  {
+		temp32=protobuf_dhmsg3.cmac(counter);
+    if(fit_32_into_uint8_t(temp32, &(native_dhmsg3->cmac[counter]))!=0)
+      return -1;
+  }
+
+  if(decode_report_from_protobuf(protobuf_dhmsg3.mutable_msg3_body()->mutable_report(), &(native_dhmsg3->msg3_body.report))==-1)
+    return -1;
+  int max_counter=protobuf_dhmsg3.mutable_msg3_body()->additional_prop_size();
+  native_dhmsg3->msg3_body.additional_prop_length=max_counter;
+  // TODO: Need to assign a variable on the heap and then pass it as an argument to this function - set it to null if protobuf_dhmsg3.mutable_msg3_body()->additional_prop_size() is 0
+  // TODO: And then free it in that function (create_session) when it is done. It is likely that it is 0 in the SGX SDK sample code. And SDK people probably didn't deserialize it - as it may contain a pointer in the general case - to the array of additional_properties.
+  if(max_counter!=0)
+    return -1;
+  return 0;
+}
+
+int print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1 /*, sgx_dh_msg1_t* native_dhmsg1*/)
+{
+	int counter;
+	printf("gx\n");
+	for(counter=0;counter<SGX_ECP256_KEY_SIZE;counter++)
+	{
+		 printf("%d ", protobuf_dhmsg1.g_a().gx(counter));
+	}
+
+	printf("\ngy\n");
+	for(counter=0;counter<SGX_ECP256_KEY_SIZE;counter++)
+	{
+		 printf("%d ", protobuf_dhmsg1.g_a().gy(counter));
+	}
+
+	printf("\nmrenclave in target\n");
+	for(counter=0;counter<SGX_HASH_SIZE;counter++)
+	{
+		 printf("%" PRIu32 " ", protobuf_dhmsg1.target().mr_enclave(counter));
+	}
+
+	printf("\nreserved1 in target\n");
+	for(counter=0;counter<SGX_TARGET_INFO_RESERVED1_BYTES;counter++)
+	{
+		 printf("%" PRIu32 " ", protobuf_dhmsg1.target().reserved1(counter));
+	}
+
+	printf("\nreserved2 in target\n");
+	for(counter=0;counter<SGX_TARGET_INFO_RESERVED2_BYTES;counter++)
+	{
+		 printf("%" PRIu32 " ", protobuf_dhmsg1.target().reserved2(counter));
+	}
+
+	printf("\n %" PRIu64 "\n", protobuf_dhmsg1.target().attributes().flags());
+	printf("\n %" PRIu64 "\n", protobuf_dhmsg1.target().attributes().xfrm());
+	printf("\n %" PRIu32 "\n", protobuf_dhmsg1.target().misc_select());
+
+	return 0;
+}
+
+void encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2)
+{
+	int counter; google::protobuf::uint32 temp32; //google::protobuf::uint64 temp64;
+	printf("\n msg2 cmac \n");
+	for(counter=0;counter<SGX_DH_MAC_SIZE;counter++)
+	{
+		temp32=native_dhmsg2->cmac[counter];
+		protobuf_dhmsg2.add_cmac(temp32);
+		printf("%d ", temp32);
+	}
+
+	encode_ec256_public_key_to_protobuf(protobuf_dhmsg2.mutable_g_b(), &(native_dhmsg2->g_b));
+
+	encode_report_to_protobuf(protobuf_dhmsg2.mutable_report(), &(native_dhmsg2->report));
+}
+
+// Got rid of the session ID - figure out its role.
+//message1 from the destination enclave through a socket set up before.
+// TODO: What do we do about session id?
+int session_request_call(int fd, sgx_dh_msg1_t* dh_msg1) //, uint32_t* session_id)
+{
+	protobuf_sgx_dh_msg1_t protobuf_msg1;
+	printf("reading msg1\n");
+	fflush(stdout);
+	if(read_protobuf_msg_from_fd(fd, protobuf_msg1)!=0)
+		return -1;
+	print_initialized_msg1(protobuf_msg1);
+	printf("\n done reading msg1 --------------------\n");
+	fflush(stdout);
+  if(decode_msg1_from_protobuf(protobuf_msg1, dh_msg1)!=0)
+    return -1;
+  return 0;
+}
+
+// Source enclave for exchange_report_ocall (like other ocalls) will be the PHP enclave and the destination enclave will be the decryptor one.
+//Makes an sgx_ecall to the destination enclave sends message2 from the source enclave and gets message 3 from the destination enclave
+// TODO: What do we do about session id?
+int exchange_report_call(int fd, sgx_dh_msg2_t *dh_msg2, sgx_dh_msg3_t *dh_msg3) // , uint32_t* session_id)
+{
+	protobuf_sgx_dh_msg2_t protobuf_msg2;
+  protobuf_sgx_dh_msg3_t protobuf_msg3;
+	printf("\n------------------------------------- generating msg2 --------\n");
+	// Fill protobuf class for dhmsg2 with contents from its native C struct.
+	encode_msg2_to_protobuf(protobuf_msg2, dh_msg2);
+	// Write msg length and then write the raw msg.
+	if(write_protobuf_msg_to_fd(fd, protobuf_msg2)!=0)
+		return -1;
+	printf("Wrote msg2 to protobuf ------------------------------------------\n");
+	fflush(stdout);
+	// Read from socket dh_msg3
+	if(read_protobuf_msg_from_fd(fd, protobuf_msg3)!=0)
+		return -1;
+ 	// Decode msg3 from protobuf to native structs
+	if(decode_msg3_from_protobuf(protobuf_msg3, dh_msg3)!=0)
+		return -1;
+ 	return 0;
+
+}
+
+//Make an sgx_ecall to the destination enclave to close the session
+int end_session_ocall()
+{
+  return SGX_SUCCESS;
+}

+ 85 - 0
SgxProtobufSealerTransforms.cpp

@@ -0,0 +1,85 @@
+
+//#include "ProtobufSgxTransforms.h"
+#include "sgx_tae_service.h"
+#include "ProtobufSealerMessages.pb.h"
+#include <string>
+
+
+namespace ProtobufSgxTransforms {
+  namespace {
+    void encode_counter_id_and_value_to_protobuf(sgx_mc_uuid_t* sgx_monotonic_counter_id, uint32_t* sgx_monotonic_counter_value, protobuf_plaintext_seal_message& protobuf_plaintext) {
+        protobuf_plaintext.mutable_monotonic_counter_id()->set_nonce(sgx_monotonic_counter_id->nonce, SGX_MC_UUID_NONCE_SIZE);
+        protobuf_plaintext.mutable_monotonic_counter_id()->set_counter_id(sgx_monotonic_counter_id->counter_id, SGX_MC_UUID_COUNTER_ID_SIZE);
+        protobuf_plaintext.set_monotonic_counter_value(*sgx_monotonic_counter_value);
+    }
+    void encode_message_to_protobuf(std::string& plaintext, protobuf_plaintext_seal_message& protobuf_plaintext) {
+      protobuf_plaintext.set_message(plaintext);
+    }
+    void encode_message_and_counter_to_protobuf(std::string& plaintext, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value, protobuf_plaintext_seal_message& protobuf_plaintext) {
+
+      encode_counter_id_and_value_to_protobuf(sgx_counter_id, sgx_counter_value, protobuf_plaintext);
+      encode_message_to_protobuf(plaintext, protobuf_plaintext);
+    }
+  }
+
+
+
+  uint32_t encode_message_and_counter_to_protobuf_string(std::string& plaintext, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value, std::string& serialized_plaintext) {
+    uint32_t ret;
+    protobuf_plaintext_seal_message protobuf_plaintext;
+    uint32_t total_plaintext_length;
+
+    encode_message_and_counter_to_protobuf(plaintext, sgx_counter_id, sgx_counter_value, protobuf_plaintext);
+
+    total_plaintext_length = protobuf_plaintext.ByteSize(); // TODO: This assignment could be problematic on platforms where the max. positive value for signed int is greater than that for unsigned int?
+    if(total_plaintext_length<=0)
+      return 1;
+
+    if(!protobuf_plaintext.SerializeToString(&serialized_plaintext))
+      return 1;
+    return 0;
+  }
+
+  void decode_protobuf_message_to_counter_id_and_value(std::string& temp_plaintext_str, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value) {
+/*	protobuf_plaintext_seal_message protobuf_encoded_msg; protobuf_encoded_msg.ParseFromString(temp_plaintext_str);
+
+    std::string protobuf_nonce = protobuf_encoded_msg.mutable_monotonic_counter_id()->nonce();
+    std::vector<uint8_t> sgx_nonce_vector(protobuf_nonce.begin(), protobuf_nonce.end());
+    uint8_t* id_char = &sgx_nonce_vector[0]; int counter;
+    for(counter=0; counter<SGX_MC_UUID_NONCE_SIZE; counter++)
+    {
+       sgx_counter_id->nonce[counter]=*id_char; id_char++;
+    }
+
+    std::string protobuf_counter_id = protobuf_encoded_msg.mutable_monotonic_counter_id()->counter_id();
+    std::vector<uint8_t> sgx_counter_id_vector(protobuf_counter_id.begin(), protobuf_counter_id.end());
+    id_char = &sgx_counter_id_vector[0];
+    for(counter=0; counter<SGX_MC_UUID_COUNTER_ID_SIZE; counter++)
+    {
+       sgx_counter_id->counter_id[counter]=*id_char; id_char++; 
+    }
+
+    *sgx_counter_value=protobuf_encoded_msg.monotonic_counter_value();
+*/
+    }
+
+  void decode_protobuf_message_to_plaintext(std::string& temp_plaintext_str , std::string& plaintext) {
+    protobuf_plaintext_seal_message protobuf_encoded_msg; protobuf_encoded_msg.ParseFromString(temp_plaintext_str);
+    plaintext = protobuf_encoded_msg.message();
+  }
+
+/*  namespace {
+    void encode_counter_id_and_value_to_protobuf(sgx_mc_uuid_t* sgx_monotonic_counter_id, uint32_t* sgx_monotonic_counter_value, protobuf_plaintext_seal_message& protobuf_plaintext) {
+        protobuf_plaintext->mutable_monotonic_counter_id()->set_nonce(sgx_monotonic_counter_id->nonce, SGX_MC_UUID_NONCE_SIZE);
+        protobuf_plaintext->mutable_monotonic_counter_id()->set_counter_id(sgx_monotonic_counter_id->counter_id, SGX_MC_UUID_COUNTER_ID_SIZE);
+        protobuf_plaintext->set_monotonic_counter_value(*sgx_monotonic_counter_value);
+    }
+    void encode_message_to_protobuf(string& plaintext, protobuf_plaintext_seal_message& protobuf_plaintext) {
+      protobuf_plaintext->set_message(plaintext);
+    }
+    void encode_message_and_counter_to_protobuf(std::string& plaintext, sgx_mc_uuid_t* sgx_monotonic_counter_id, uint32_t* sgx_monotonic_counter_value, protobuf_plaintext_seal_message& protobuf_plaintext) {
+      encode_counter_id_and_value_to_protobuf(&sgx_counter_id, &sgx_counter_value, protobuf_plaintext);
+      encode_message_to_protobuf(plaintext, protobuf_plaintext);
+    }
+  }*/
+}

+ 252 - 0
SgxSealer.cpp

@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "sgx.h"
+#include "sgx_tseal.h"  // For sgx_seal_data, sgx_calc_sealed_data_size, sgx_get_encrypt_txt_len, sgx_unseal_data
+#include "sgx_tae_service.h" // For create, read counters and pse_session. Also exports SGX_MC_UUID_NONCE_SIZE and SGX_MC_UUID_COUNTER_ID_SIZE, TODO: apparently also ne$
+#include "sgx_uae_service.h" // for sgx_ps_get_cap and SGX_IS_MONOTONIC_COUNTER_AVAILABLE
+#include <string>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <vector>
+//#include "ProtobufSgxTransforms.h"
+#include "ProtobufSgxSealerTransforms.h"
+
+
+//class Sealer {
+
+//  namespace {
+    uint32_t verify_sgx_monotonic_counter_value(sgx_mc_uuid_t* sgx_monotonic_counter_id, uint32_t* sgx_monotonic_counter_value)
+    {
+/*        uint32_t ret = 0;
+        uint32_t expected_counter_value;
+        int busy_retry_times = 2;
+
+        do{
+            ret = sgx_create_pse_session();
+        }while (ret == SGX_ERROR_BUSY && busy_retry_times--);
+        if (ret != SGX_SUCCESS)
+            return ret;
+
+        ret = sgx_read_monotonic_counter(sgx_monotonic_counter_id,&expected_counter_value);
+        if(ret != SGX_SUCCESS)
+        {
+            switch(ret)
+            {
+            case SGX_ERROR_SERVICE_UNAVAILABLE:
+                // Architecture Enclave Service Manager is not installed or not working properly.
+                    break;
+            case SGX_ERROR_SERVICE_TIMEOUT:
+                // retry the operation later
+                    break;
+            case SGX_ERROR_BUSY:
+                // retry the operation later
+                    break;
+            case SGX_ERROR_MC_NOT_FOUND:
+                // the the Monotonic Counter ID is invalid.
+                    break;
+            default:
+                // other errors
+                break;
+            }
+        }
+        else if(expected_counter_value!=*sgx_monotonic_counter_value)
+        {
+            ret = 3; //REPLAY_DETECTED; // This must be by the OS.
+        }
+        sgx_close_pse_session();
+*/
+        return SGX_SUCCESS; //ret;
+    }
+
+    uint32_t create_sgx_monotonic_counter_id_and_value(sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value)
+    {
+    int counter=0;
+    for(counter=0;counter<3;counter++)
+    {
+       sgx_counter_id->nonce[counter]=1;
+    }
+    for(counter=0;counter<13;counter++)
+    {
+       sgx_counter_id->counter_id[counter]=1;
+    }
+
+//sgx_counter_id->nonce={0,0,0,0}; 
+//sgx_counter_id->counter_id={0,0,0,0,0,0,0,0,0,0,0,0,0}; 
+*sgx_counter_value=1; 
+/*
+      uint32_t ret = 0;
+      int busy_retry_times = 2;
+
+      do{
+          ret = sgx_create_pse_session();
+      }while (ret == SGX_ERROR_BUSY && busy_retry_times--);
+      if (ret != SGX_SUCCESS)
+          return ret;
+
+      ret = sgx_create_monotonic_counter(sgx_counter_id,sgx_counter_value);
+          if(ret != SGX_SUCCESS)
+          {
+              switch(ret)
+              {
+              case SGX_ERROR_SERVICE_UNAVAILABLE:
+                  // Architecture Enclave Service Manager is not installed or not working properly
+                  break;
+              case SGX_ERROR_SERVICE_TIMEOUT:
+                  // retry the operation latersgx_create_monotonic_counter
+                  break;
+              case SGX_ERROR_BUSY:
+                  // retry the operation later
+                  break;
+              case SGX_ERROR_MC_OVER_QUOTA:
+                  // SGX Platform Service enforces a quota scheme on the Monotonic Counters a SGX app can maintain. the enclave has reached the quota.
+                  break;
+              case SGX_ERROR_MC_USED_UP:
+                  // the Monotonic Counter has been used up and cannot create Monotonic Counter anymore.
+                  break;
+              default:
+                  // other errors
+                  break;
+              }
+          }
+          
+
+      sgx_close_pse_session(); // TODO: Check that we should do it here.
+*/
+  return SGX_SUCCESS; // ret; 
+    }
+
+
+  uint32_t initialize_pse_and_counter()
+  {
+    /*
+    sgx_status_t sgx_ret;
+    sgx_ps_cap_t ps_cap;
+    memset(&ps_cap, 0, sizeof(sgx_ps_cap_t));
+    sgx_ret = sgx_get_ps_cap(&ps_cap);
+    if (sgx_ret)
+    {
+    //    printf("cannot get platform service capability, error code = 0x%d", sgx_ret); 
+        return sgx_ret;
+    }
+    if (!SGX_IS_MONOTONIC_COUNTER_AVAILABLE(ps_cap))
+    {
+    //    printf("\nmonotonic counter is not supported\n");
+        return SGX_ERROR_SERVICE_UNAVAILABLE;
+    }*/
+    return SGX_SUCCESS;
+  }
+ uint32_t seal_message(std::string& plaintext_str, std::string& sgx_sealed_msg_str)
+ {
+//   std::string protobuf_plaintext_str;
+   uint32_t ret;
+//   sgx_mc_uuid_t sgx_counter_id;
+//   uint32_t sgx_counter_value;
+   uint8_t* sgx_sealed_msg;
+   uint32_t expected_sealed_msg_length;
+
+/*   ret = create_sgx_monotonic_counter_id_and_value(&sgx_counter_id, &sgx_counter_value);
+   if(ret!=SGX_SUCCESS)
+     return ret;
+
+   ProtobufSgxTransforms::encode_message_and_counter_to_protobuf_string(plaintext_str, &sgx_counter_id, &sgx_counter_value, protobuf_plaintext_str);
+*/   expected_sealed_msg_length = sgx_calc_sealed_data_size(0, 9);
+   if(expected_sealed_msg_length == 0xFFFFFFFF)
+       return 1;
+   sgx_sealed_msg = (uint8_t*)malloc(expected_sealed_msg_length); // Doesn't change with protobufs - convert the data here to protobuf format after it is initialized
+
+   ret = sgx_seal_data(0, NULL, 9, (uint8_t*) plaintext_str.c_str(), expected_sealed_msg_length, (sgx_sealed_data_t*) sgx_sealed_msg); 
+   sgx_sealed_msg_str = std::string((char*)sgx_sealed_msg, expected_sealed_msg_length); // TODO: Fishy conversion.
+   free(sgx_sealed_msg);
+   return ret;
+ }
+
+ uint32_t unseal_and_verify_sealed_message(std::string& sgx_sealed_msg_str, std::string& plaintext)
+ {    
+    uint32_t ret = 0;
+    uint8_t* sgx_sealed_msg; 
+    uint8_t* temp_plaintext;
+    std::string protobuf_encoded_str; std::string decoded_plaintext;
+    sgx_mc_uuid_t sgx_counter_id;
+    uint32_t sgx_counter_value;
+    uint32_t expected_plaintext_msg_length;
+
+    std::vector<uint8_t> sgx_sealed_msg_vector(sgx_sealed_msg_str.begin(), sgx_sealed_msg_str.end());// TODO: Add null termination? 
+    sgx_sealed_msg = &sgx_sealed_msg_vector[0]; 
+    expected_plaintext_msg_length = sgx_get_encrypt_txt_len((sgx_sealed_data_t*)sgx_sealed_msg);
+    if(expected_plaintext_msg_length == 0xffffffff)
+      return 1;
+//    return expected_plaintext_msg_length;
+    temp_plaintext = (uint8_t*)malloc( expected_plaintext_msg_length );
+    ret = sgx_unseal_data((sgx_sealed_data_t*)sgx_sealed_msg, NULL, 0, temp_plaintext, &expected_plaintext_msg_length);
+    if(ret != SGX_SUCCESS)
+    {
+	free(temp_plaintext); 
+        switch(ret)
+        {
+        case SGX_ERROR_MAC_MISMATCH:
+            // MAC of the sealed data is incorrect.          The sealed data has been tampered.
+            break;
+        case SGX_ERROR_INVALID_ATTRIBUTE:
+            // Indicates attribute field of the sealed data is incorrect.
+            break;
+        case SGX_ERROR_INVALID_ISVSVN:
+            // Indicates isv_svn field of the sealed data is greater than            the enclave�s ISVSVN. This is a downgraded enclave.
+            break;
+        case SGX_ERROR_INVALID_CPUSVN:
+            // Indicates cpu_svn field of the sealed data is greater than            the platform�s cpu_svn. enclave is  on a downgraded platform.
+            break;
+        case SGX_ERROR_INVALID_KEYNAME:
+            // Indicates key_name field of the sealed data is incorrect.
+            break;
+        default:
+            // other errors
+            break;
+        }
+        return ret;
+    }
+
+    protobuf_encoded_str = std::string((char*)temp_plaintext, expected_plaintext_msg_length); // TODO: Fishy conversion. 
+
+    free(temp_plaintext); 
+/*    ProtobufSgxTransforms::decode_protobuf_message_to_counter_id_and_value(protobuf_encoded_str, &sgx_counter_id, &sgx_counter_value);
+    ret = verify_sgx_monotonic_counter_value(&sgx_counter_id, &sgx_counter_value);
+    if (ret == SGX_SUCCESS)
+    {
+          ProtobufSgxTransforms::decode_protobuf_message_to_plaintext(protobuf_encoded_str, decoded_plaintext);
+          plaintext = decoded_plaintext;
+    }
+*/plaintext = protobuf_encoded_str; 
+    return ret; 
+  }
+
+//}

+ 2324 - 0
include/ProtobufLAMessages.h

@@ -0,0 +1,2324 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: dhmsgs.proto
+
+#ifndef PROTOBUF_dhmsgs_2eproto__INCLUDED
+#define PROTOBUF_dhmsgs_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2006000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+// @@protoc_insertion_point(includes)
+
+// Internal implementation detail -- do not call these.
+void  protobuf_AddDesc_dhmsgs_2eproto();
+void protobuf_AssignDesc_dhmsgs_2eproto();
+void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+class protobuf_sgx_attributes_t;
+class protobuf_sgx_ec256_public_t;
+class protobuf_sgx_report_body_t;
+class protobuf_sgx_report_t;
+class protobuf_sgx_target_info_t;
+class protobuf_sgx_dh_msg1_t;
+class protobuf_sgx_dh_msg2_t;
+class protobuf_sgx_dh_msg3_body_t;
+class protobuf_sgx_dh_msg3_t;
+
+// ===================================================================
+
+class protobuf_sgx_attributes_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_attributes_t();
+  virtual ~protobuf_sgx_attributes_t();
+
+  protobuf_sgx_attributes_t(const protobuf_sgx_attributes_t& from);
+
+  inline protobuf_sgx_attributes_t& operator=(const protobuf_sgx_attributes_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_attributes_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_attributes_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_attributes_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_attributes_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_attributes_t& from);
+  void MergeFrom(const protobuf_sgx_attributes_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required uint64 flags = 1;
+  inline bool has_flags() const;
+  inline void clear_flags();
+  static const int kFlagsFieldNumber = 1;
+  inline ::google::protobuf::uint64 flags() const;
+  inline void set_flags(::google::protobuf::uint64 value);
+
+  // required uint64 xfrm = 2;
+  inline bool has_xfrm() const;
+  inline void clear_xfrm();
+  static const int kXfrmFieldNumber = 2;
+  inline ::google::protobuf::uint64 xfrm() const;
+  inline void set_xfrm(::google::protobuf::uint64 value);
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_attributes_t)
+ private:
+  inline void set_has_flags();
+  inline void clear_has_flags();
+  inline void set_has_xfrm();
+  inline void clear_has_xfrm();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::uint64 flags_;
+  ::google::protobuf::uint64 xfrm_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_attributes_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_ec256_public_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_ec256_public_t();
+  virtual ~protobuf_sgx_ec256_public_t();
+
+  protobuf_sgx_ec256_public_t(const protobuf_sgx_ec256_public_t& from);
+
+  inline protobuf_sgx_ec256_public_t& operator=(const protobuf_sgx_ec256_public_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_ec256_public_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_ec256_public_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_ec256_public_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_ec256_public_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_ec256_public_t& from);
+  void MergeFrom(const protobuf_sgx_ec256_public_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 gx = 1 [packed = true];
+  inline int gx_size() const;
+  inline void clear_gx();
+  static const int kGxFieldNumber = 1;
+  inline ::google::protobuf::uint32 gx(int index) const;
+  inline void set_gx(int index, ::google::protobuf::uint32 value);
+  inline void add_gx(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      gx() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_gx();
+
+  // repeated uint32 gy = 2 [packed = true];
+  inline int gy_size() const;
+  inline void clear_gy();
+  static const int kGyFieldNumber = 2;
+  inline ::google::protobuf::uint32 gy(int index) const;
+  inline void set_gy(int index, ::google::protobuf::uint32 value);
+  inline void add_gy(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      gy() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_gy();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_ec256_public_t)
+ private:
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > gx_;
+  mutable int _gx_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > gy_;
+  mutable int _gy_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_ec256_public_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_report_body_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_report_body_t();
+  virtual ~protobuf_sgx_report_body_t();
+
+  protobuf_sgx_report_body_t(const protobuf_sgx_report_body_t& from);
+
+  inline protobuf_sgx_report_body_t& operator=(const protobuf_sgx_report_body_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_report_body_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_report_body_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_report_body_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_report_body_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_report_body_t& from);
+  void MergeFrom(const protobuf_sgx_report_body_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 cpu_svn = 1 [packed = true];
+  inline int cpu_svn_size() const;
+  inline void clear_cpu_svn();
+  static const int kCpuSvnFieldNumber = 1;
+  inline ::google::protobuf::uint32 cpu_svn(int index) const;
+  inline void set_cpu_svn(int index, ::google::protobuf::uint32 value);
+  inline void add_cpu_svn(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cpu_svn() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cpu_svn();
+
+  // required uint32 misc_select = 9;
+  inline bool has_misc_select() const;
+  inline void clear_misc_select();
+  static const int kMiscSelectFieldNumber = 9;
+  inline ::google::protobuf::uint32 misc_select() const;
+  inline void set_misc_select(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  inline int reserved1_size() const;
+  inline void clear_reserved1();
+  static const int kReserved1FieldNumber = 2;
+  inline ::google::protobuf::uint32 reserved1(int index) const;
+  inline void set_reserved1(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved1(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved1() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved1();
+
+  // required .protobuf_sgx_attributes_t attributes = 10;
+  inline bool has_attributes() const;
+  inline void clear_attributes();
+  static const int kAttributesFieldNumber = 10;
+  inline const ::protobuf_sgx_attributes_t& attributes() const;
+  inline ::protobuf_sgx_attributes_t* mutable_attributes();
+  inline ::protobuf_sgx_attributes_t* release_attributes();
+  inline void set_allocated_attributes(::protobuf_sgx_attributes_t* attributes);
+
+  // repeated uint32 mr_enclave = 3 [packed = true];
+  inline int mr_enclave_size() const;
+  inline void clear_mr_enclave();
+  static const int kMrEnclaveFieldNumber = 3;
+  inline ::google::protobuf::uint32 mr_enclave(int index) const;
+  inline void set_mr_enclave(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_enclave(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_enclave() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_enclave();
+
+  // repeated uint32 reserved2 = 4 [packed = true];
+  inline int reserved2_size() const;
+  inline void clear_reserved2();
+  static const int kReserved2FieldNumber = 4;
+  inline ::google::protobuf::uint32 reserved2(int index) const;
+  inline void set_reserved2(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved2(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved2() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved2();
+
+  // repeated uint32 mr_signer = 5 [packed = true];
+  inline int mr_signer_size() const;
+  inline void clear_mr_signer();
+  static const int kMrSignerFieldNumber = 5;
+  inline ::google::protobuf::uint32 mr_signer(int index) const;
+  inline void set_mr_signer(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_signer(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_signer() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_signer();
+
+  // repeated uint32 reserved3 = 6 [packed = true];
+  inline int reserved3_size() const;
+  inline void clear_reserved3();
+  static const int kReserved3FieldNumber = 6;
+  inline ::google::protobuf::uint32 reserved3(int index) const;
+  inline void set_reserved3(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved3(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved3() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved3();
+
+  // required uint32 isv_prod_id = 11;
+  inline bool has_isv_prod_id() const;
+  inline void clear_isv_prod_id();
+  static const int kIsvProdIdFieldNumber = 11;
+  inline ::google::protobuf::uint32 isv_prod_id() const;
+  inline void set_isv_prod_id(::google::protobuf::uint32 value);
+
+  // required uint32 isv_svn = 12;
+  inline bool has_isv_svn() const;
+  inline void clear_isv_svn();
+  static const int kIsvSvnFieldNumber = 12;
+  inline ::google::protobuf::uint32 isv_svn() const;
+  inline void set_isv_svn(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved4 = 7 [packed = true];
+  inline int reserved4_size() const;
+  inline void clear_reserved4();
+  static const int kReserved4FieldNumber = 7;
+  inline ::google::protobuf::uint32 reserved4(int index) const;
+  inline void set_reserved4(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved4(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved4() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved4();
+
+  // repeated uint32 report_data = 8 [packed = true];
+  inline int report_data_size() const;
+  inline void clear_report_data();
+  static const int kReportDataFieldNumber = 8;
+  inline ::google::protobuf::uint32 report_data(int index) const;
+  inline void set_report_data(int index, ::google::protobuf::uint32 value);
+  inline void add_report_data(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      report_data() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_report_data();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_report_body_t)
+ private:
+  inline void set_has_misc_select();
+  inline void clear_has_misc_select();
+  inline void set_has_attributes();
+  inline void clear_has_attributes();
+  inline void set_has_isv_prod_id();
+  inline void clear_has_isv_prod_id();
+  inline void set_has_isv_svn();
+  inline void clear_has_isv_svn();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cpu_svn_;
+  mutable int _cpu_svn_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved1_;
+  mutable int _reserved1_cached_byte_size_;
+  ::protobuf_sgx_attributes_t* attributes_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_enclave_;
+  mutable int _mr_enclave_cached_byte_size_;
+  ::google::protobuf::uint32 misc_select_;
+  ::google::protobuf::uint32 isv_prod_id_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved2_;
+  mutable int _reserved2_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_signer_;
+  mutable int _mr_signer_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved3_;
+  mutable int _reserved3_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved4_;
+  mutable int _reserved4_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > report_data_;
+  mutable int _report_data_cached_byte_size_;
+  ::google::protobuf::uint32 isv_svn_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_report_body_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_report_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_report_t();
+  virtual ~protobuf_sgx_report_t();
+
+  protobuf_sgx_report_t(const protobuf_sgx_report_t& from);
+
+  inline protobuf_sgx_report_t& operator=(const protobuf_sgx_report_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_report_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_report_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_report_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_report_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_report_t& from);
+  void MergeFrom(const protobuf_sgx_report_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_report_body_t body = 1;
+  inline bool has_body() const;
+  inline void clear_body();
+  static const int kBodyFieldNumber = 1;
+  inline const ::protobuf_sgx_report_body_t& body() const;
+  inline ::protobuf_sgx_report_body_t* mutable_body();
+  inline ::protobuf_sgx_report_body_t* release_body();
+  inline void set_allocated_body(::protobuf_sgx_report_body_t* body);
+
+  // repeated uint32 key_id = 2 [packed = true];
+  inline int key_id_size() const;
+  inline void clear_key_id();
+  static const int kKeyIdFieldNumber = 2;
+  inline ::google::protobuf::uint32 key_id(int index) const;
+  inline void set_key_id(int index, ::google::protobuf::uint32 value);
+  inline void add_key_id(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      key_id() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_key_id();
+
+  // repeated uint32 mac = 3 [packed = true];
+  inline int mac_size() const;
+  inline void clear_mac();
+  static const int kMacFieldNumber = 3;
+  inline ::google::protobuf::uint32 mac(int index) const;
+  inline void set_mac(int index, ::google::protobuf::uint32 value);
+  inline void add_mac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_report_t)
+ private:
+  inline void set_has_body();
+  inline void clear_has_body();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_report_body_t* body_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > key_id_;
+  mutable int _key_id_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mac_;
+  mutable int _mac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_report_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_target_info_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_target_info_t();
+  virtual ~protobuf_sgx_target_info_t();
+
+  protobuf_sgx_target_info_t(const protobuf_sgx_target_info_t& from);
+
+  inline protobuf_sgx_target_info_t& operator=(const protobuf_sgx_target_info_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_target_info_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_target_info_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_target_info_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_target_info_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_target_info_t& from);
+  void MergeFrom(const protobuf_sgx_target_info_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 mr_enclave = 1 [packed = true];
+  inline int mr_enclave_size() const;
+  inline void clear_mr_enclave();
+  static const int kMrEnclaveFieldNumber = 1;
+  inline ::google::protobuf::uint32 mr_enclave(int index) const;
+  inline void set_mr_enclave(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_enclave(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_enclave() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_enclave();
+
+  // required .protobuf_sgx_attributes_t attributes = 4;
+  inline bool has_attributes() const;
+  inline void clear_attributes();
+  static const int kAttributesFieldNumber = 4;
+  inline const ::protobuf_sgx_attributes_t& attributes() const;
+  inline ::protobuf_sgx_attributes_t* mutable_attributes();
+  inline ::protobuf_sgx_attributes_t* release_attributes();
+  inline void set_allocated_attributes(::protobuf_sgx_attributes_t* attributes);
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  inline int reserved1_size() const;
+  inline void clear_reserved1();
+  static const int kReserved1FieldNumber = 2;
+  inline ::google::protobuf::uint32 reserved1(int index) const;
+  inline void set_reserved1(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved1(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved1() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved1();
+
+  // required uint32 misc_select = 5;
+  inline bool has_misc_select() const;
+  inline void clear_misc_select();
+  static const int kMiscSelectFieldNumber = 5;
+  inline ::google::protobuf::uint32 misc_select() const;
+  inline void set_misc_select(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved2 = 3 [packed = true];
+  inline int reserved2_size() const;
+  inline void clear_reserved2();
+  static const int kReserved2FieldNumber = 3;
+  inline ::google::protobuf::uint32 reserved2(int index) const;
+  inline void set_reserved2(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved2(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved2() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved2();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_target_info_t)
+ private:
+  inline void set_has_attributes();
+  inline void clear_has_attributes();
+  inline void set_has_misc_select();
+  inline void clear_has_misc_select();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_enclave_;
+  mutable int _mr_enclave_cached_byte_size_;
+  ::protobuf_sgx_attributes_t* attributes_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved1_;
+  mutable int _reserved1_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved2_;
+  mutable int _reserved2_cached_byte_size_;
+  ::google::protobuf::uint32 misc_select_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_target_info_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg1_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg1_t();
+  virtual ~protobuf_sgx_dh_msg1_t();
+
+  protobuf_sgx_dh_msg1_t(const protobuf_sgx_dh_msg1_t& from);
+
+  inline protobuf_sgx_dh_msg1_t& operator=(const protobuf_sgx_dh_msg1_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg1_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg1_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg1_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg1_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg1_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg1_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_ec256_public_t g_a = 1;
+  inline bool has_g_a() const;
+  inline void clear_g_a();
+  static const int kGAFieldNumber = 1;
+  inline const ::protobuf_sgx_ec256_public_t& g_a() const;
+  inline ::protobuf_sgx_ec256_public_t* mutable_g_a();
+  inline ::protobuf_sgx_ec256_public_t* release_g_a();
+  inline void set_allocated_g_a(::protobuf_sgx_ec256_public_t* g_a);
+
+  // required .protobuf_sgx_target_info_t target = 2;
+  inline bool has_target() const;
+  inline void clear_target();
+  static const int kTargetFieldNumber = 2;
+  inline const ::protobuf_sgx_target_info_t& target() const;
+  inline ::protobuf_sgx_target_info_t* mutable_target();
+  inline ::protobuf_sgx_target_info_t* release_target();
+  inline void set_allocated_target(::protobuf_sgx_target_info_t* target);
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg1_t)
+ private:
+  inline void set_has_g_a();
+  inline void clear_has_g_a();
+  inline void set_has_target();
+  inline void clear_has_target();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_ec256_public_t* g_a_;
+  ::protobuf_sgx_target_info_t* target_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg1_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg2_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg2_t();
+  virtual ~protobuf_sgx_dh_msg2_t();
+
+  protobuf_sgx_dh_msg2_t(const protobuf_sgx_dh_msg2_t& from);
+
+  inline protobuf_sgx_dh_msg2_t& operator=(const protobuf_sgx_dh_msg2_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg2_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg2_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg2_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg2_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg2_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg2_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_ec256_public_t g_b = 1;
+  inline bool has_g_b() const;
+  inline void clear_g_b();
+  static const int kGBFieldNumber = 1;
+  inline const ::protobuf_sgx_ec256_public_t& g_b() const;
+  inline ::protobuf_sgx_ec256_public_t* mutable_g_b();
+  inline ::protobuf_sgx_ec256_public_t* release_g_b();
+  inline void set_allocated_g_b(::protobuf_sgx_ec256_public_t* g_b);
+
+  // required .protobuf_sgx_report_t report = 2;
+  inline bool has_report() const;
+  inline void clear_report();
+  static const int kReportFieldNumber = 2;
+  inline const ::protobuf_sgx_report_t& report() const;
+  inline ::protobuf_sgx_report_t* mutable_report();
+  inline ::protobuf_sgx_report_t* release_report();
+  inline void set_allocated_report(::protobuf_sgx_report_t* report);
+
+  // repeated uint32 cmac = 3 [packed = true];
+  inline int cmac_size() const;
+  inline void clear_cmac();
+  static const int kCmacFieldNumber = 3;
+  inline ::google::protobuf::uint32 cmac(int index) const;
+  inline void set_cmac(int index, ::google::protobuf::uint32 value);
+  inline void add_cmac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cmac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cmac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg2_t)
+ private:
+  inline void set_has_g_b();
+  inline void clear_has_g_b();
+  inline void set_has_report();
+  inline void clear_has_report();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_ec256_public_t* g_b_;
+  ::protobuf_sgx_report_t* report_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cmac_;
+  mutable int _cmac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg2_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg3_body_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg3_body_t();
+  virtual ~protobuf_sgx_dh_msg3_body_t();
+
+  protobuf_sgx_dh_msg3_body_t(const protobuf_sgx_dh_msg3_body_t& from);
+
+  inline protobuf_sgx_dh_msg3_body_t& operator=(const protobuf_sgx_dh_msg3_body_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg3_body_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg3_body_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg3_body_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg3_body_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg3_body_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg3_body_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_report_t report = 1;
+  inline bool has_report() const;
+  inline void clear_report();
+  static const int kReportFieldNumber = 1;
+  inline const ::protobuf_sgx_report_t& report() const;
+  inline ::protobuf_sgx_report_t* mutable_report();
+  inline ::protobuf_sgx_report_t* release_report();
+  inline void set_allocated_report(::protobuf_sgx_report_t* report);
+
+  // repeated uint32 additional_prop = 2;
+  inline int additional_prop_size() const;
+  inline void clear_additional_prop();
+  static const int kAdditionalPropFieldNumber = 2;
+  inline ::google::protobuf::uint32 additional_prop(int index) const;
+  inline void set_additional_prop(int index, ::google::protobuf::uint32 value);
+  inline void add_additional_prop(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      additional_prop() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_additional_prop();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg3_body_t)
+ private:
+  inline void set_has_report();
+  inline void clear_has_report();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_report_t* report_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > additional_prop_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg3_body_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg3_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg3_t();
+  virtual ~protobuf_sgx_dh_msg3_t();
+
+  protobuf_sgx_dh_msg3_t(const protobuf_sgx_dh_msg3_t& from);
+
+  inline protobuf_sgx_dh_msg3_t& operator=(const protobuf_sgx_dh_msg3_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg3_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg3_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg3_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg3_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg3_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg3_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+  inline bool has_msg3_body() const;
+  inline void clear_msg3_body();
+  static const int kMsg3BodyFieldNumber = 1;
+  inline const ::protobuf_sgx_dh_msg3_body_t& msg3_body() const;
+  inline ::protobuf_sgx_dh_msg3_body_t* mutable_msg3_body();
+  inline ::protobuf_sgx_dh_msg3_body_t* release_msg3_body();
+  inline void set_allocated_msg3_body(::protobuf_sgx_dh_msg3_body_t* msg3_body);
+
+  // repeated uint32 cmac = 2 [packed = true];
+  inline int cmac_size() const;
+  inline void clear_cmac();
+  static const int kCmacFieldNumber = 2;
+  inline ::google::protobuf::uint32 cmac(int index) const;
+  inline void set_cmac(int index, ::google::protobuf::uint32 value);
+  inline void add_cmac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cmac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cmac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg3_t)
+ private:
+  inline void set_has_msg3_body();
+  inline void clear_has_msg3_body();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_dh_msg3_body_t* msg3_body_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cmac_;
+  mutable int _cmac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_dhmsgs_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_dhmsgs_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_dhmsgs_2eproto();
+  friend void protobuf_ShutdownFile_dhmsgs_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg3_t* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// protobuf_sgx_attributes_t
+
+// required uint64 flags = 1;
+inline bool protobuf_sgx_attributes_t::has_flags() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_attributes_t::set_has_flags() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_attributes_t::clear_has_flags() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_attributes_t::clear_flags() {
+  flags_ = GOOGLE_ULONGLONG(0);
+  clear_has_flags();
+}
+inline ::google::protobuf::uint64 protobuf_sgx_attributes_t::flags() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_attributes_t.flags)
+  return flags_;
+}
+inline void protobuf_sgx_attributes_t::set_flags(::google::protobuf::uint64 value) {
+  set_has_flags();
+  flags_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_attributes_t.flags)
+}
+
+// required uint64 xfrm = 2;
+inline bool protobuf_sgx_attributes_t::has_xfrm() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_attributes_t::set_has_xfrm() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_attributes_t::clear_has_xfrm() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_attributes_t::clear_xfrm() {
+  xfrm_ = GOOGLE_ULONGLONG(0);
+  clear_has_xfrm();
+}
+inline ::google::protobuf::uint64 protobuf_sgx_attributes_t::xfrm() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_attributes_t.xfrm)
+  return xfrm_;
+}
+inline void protobuf_sgx_attributes_t::set_xfrm(::google::protobuf::uint64 value) {
+  set_has_xfrm();
+  xfrm_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_attributes_t.xfrm)
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_ec256_public_t
+
+// repeated uint32 gx = 1 [packed = true];
+inline int protobuf_sgx_ec256_public_t::gx_size() const {
+  return gx_.size();
+}
+inline void protobuf_sgx_ec256_public_t::clear_gx() {
+  gx_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_ec256_public_t::gx(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_ec256_public_t.gx)
+  return gx_.Get(index);
+}
+inline void protobuf_sgx_ec256_public_t::set_gx(int index, ::google::protobuf::uint32 value) {
+  gx_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_ec256_public_t.gx)
+}
+inline void protobuf_sgx_ec256_public_t::add_gx(::google::protobuf::uint32 value) {
+  gx_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_ec256_public_t.gx)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_ec256_public_t::gx() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_ec256_public_t.gx)
+  return gx_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_ec256_public_t::mutable_gx() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_ec256_public_t.gx)
+  return &gx_;
+}
+
+// repeated uint32 gy = 2 [packed = true];
+inline int protobuf_sgx_ec256_public_t::gy_size() const {
+  return gy_.size();
+}
+inline void protobuf_sgx_ec256_public_t::clear_gy() {
+  gy_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_ec256_public_t::gy(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_ec256_public_t.gy)
+  return gy_.Get(index);
+}
+inline void protobuf_sgx_ec256_public_t::set_gy(int index, ::google::protobuf::uint32 value) {
+  gy_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_ec256_public_t.gy)
+}
+inline void protobuf_sgx_ec256_public_t::add_gy(::google::protobuf::uint32 value) {
+  gy_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_ec256_public_t.gy)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_ec256_public_t::gy() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_ec256_public_t.gy)
+  return gy_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_ec256_public_t::mutable_gy() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_ec256_public_t.gy)
+  return &gy_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_report_body_t
+
+// repeated uint32 cpu_svn = 1 [packed = true];
+inline int protobuf_sgx_report_body_t::cpu_svn_size() const {
+  return cpu_svn_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_cpu_svn() {
+  cpu_svn_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::cpu_svn(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.cpu_svn)
+  return cpu_svn_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_cpu_svn(int index, ::google::protobuf::uint32 value) {
+  cpu_svn_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.cpu_svn)
+}
+inline void protobuf_sgx_report_body_t::add_cpu_svn(::google::protobuf::uint32 value) {
+  cpu_svn_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.cpu_svn)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::cpu_svn() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.cpu_svn)
+  return cpu_svn_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_cpu_svn() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.cpu_svn)
+  return &cpu_svn_;
+}
+
+// required uint32 misc_select = 9;
+inline bool protobuf_sgx_report_body_t::has_misc_select() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_misc_select() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_misc_select() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_report_body_t::clear_misc_select() {
+  misc_select_ = 0u;
+  clear_has_misc_select();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::misc_select() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.misc_select)
+  return misc_select_;
+}
+inline void protobuf_sgx_report_body_t::set_misc_select(::google::protobuf::uint32 value) {
+  set_has_misc_select();
+  misc_select_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.misc_select)
+}
+
+// repeated uint32 reserved1 = 2 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved1_size() const {
+  return reserved1_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved1() {
+  reserved1_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved1(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved1)
+  return reserved1_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved1(int index, ::google::protobuf::uint32 value) {
+  reserved1_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved1)
+}
+inline void protobuf_sgx_report_body_t::add_reserved1(::google::protobuf::uint32 value) {
+  reserved1_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved1)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved1() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved1)
+  return reserved1_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved1() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved1)
+  return &reserved1_;
+}
+
+// required .protobuf_sgx_attributes_t attributes = 10;
+inline bool protobuf_sgx_report_body_t::has_attributes() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_attributes() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_attributes() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void protobuf_sgx_report_body_t::clear_attributes() {
+  if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+  clear_has_attributes();
+}
+inline const ::protobuf_sgx_attributes_t& protobuf_sgx_report_body_t::attributes() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.attributes)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return attributes_ != NULL ? *attributes_ : *default_instance().attributes_;
+#else
+  return attributes_ != NULL ? *attributes_ : *default_instance_->attributes_;
+#endif
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_report_body_t::mutable_attributes() {
+  set_has_attributes();
+  if (attributes_ == NULL) attributes_ = new ::protobuf_sgx_attributes_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_report_body_t.attributes)
+  return attributes_;
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_report_body_t::release_attributes() {
+  clear_has_attributes();
+  ::protobuf_sgx_attributes_t* temp = attributes_;
+  attributes_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_report_body_t::set_allocated_attributes(::protobuf_sgx_attributes_t* attributes) {
+  delete attributes_;
+  attributes_ = attributes;
+  if (attributes) {
+    set_has_attributes();
+  } else {
+    clear_has_attributes();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_report_body_t.attributes)
+}
+
+// repeated uint32 mr_enclave = 3 [packed = true];
+inline int protobuf_sgx_report_body_t::mr_enclave_size() const {
+  return mr_enclave_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_mr_enclave() {
+  mr_enclave_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::mr_enclave(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.mr_enclave)
+  return mr_enclave_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_mr_enclave(int index, ::google::protobuf::uint32 value) {
+  mr_enclave_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.mr_enclave)
+}
+inline void protobuf_sgx_report_body_t::add_mr_enclave(::google::protobuf::uint32 value) {
+  mr_enclave_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.mr_enclave)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::mr_enclave() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.mr_enclave)
+  return mr_enclave_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_mr_enclave() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.mr_enclave)
+  return &mr_enclave_;
+}
+
+// repeated uint32 reserved2 = 4 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved2_size() const {
+  return reserved2_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved2() {
+  reserved2_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved2(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved2)
+  return reserved2_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved2(int index, ::google::protobuf::uint32 value) {
+  reserved2_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved2)
+}
+inline void protobuf_sgx_report_body_t::add_reserved2(::google::protobuf::uint32 value) {
+  reserved2_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved2)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved2() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved2)
+  return reserved2_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved2() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved2)
+  return &reserved2_;
+}
+
+// repeated uint32 mr_signer = 5 [packed = true];
+inline int protobuf_sgx_report_body_t::mr_signer_size() const {
+  return mr_signer_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_mr_signer() {
+  mr_signer_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::mr_signer(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.mr_signer)
+  return mr_signer_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_mr_signer(int index, ::google::protobuf::uint32 value) {
+  mr_signer_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.mr_signer)
+}
+inline void protobuf_sgx_report_body_t::add_mr_signer(::google::protobuf::uint32 value) {
+  mr_signer_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.mr_signer)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::mr_signer() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.mr_signer)
+  return mr_signer_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_mr_signer() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.mr_signer)
+  return &mr_signer_;
+}
+
+// repeated uint32 reserved3 = 6 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved3_size() const {
+  return reserved3_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved3() {
+  reserved3_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved3(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved3)
+  return reserved3_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved3(int index, ::google::protobuf::uint32 value) {
+  reserved3_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved3)
+}
+inline void protobuf_sgx_report_body_t::add_reserved3(::google::protobuf::uint32 value) {
+  reserved3_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved3)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved3() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved3)
+  return reserved3_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved3() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved3)
+  return &reserved3_;
+}
+
+// required uint32 isv_prod_id = 11;
+inline bool protobuf_sgx_report_body_t::has_isv_prod_id() const {
+  return (_has_bits_[0] & 0x00000100u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_isv_prod_id() {
+  _has_bits_[0] |= 0x00000100u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_isv_prod_id() {
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline void protobuf_sgx_report_body_t::clear_isv_prod_id() {
+  isv_prod_id_ = 0u;
+  clear_has_isv_prod_id();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::isv_prod_id() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.isv_prod_id)
+  return isv_prod_id_;
+}
+inline void protobuf_sgx_report_body_t::set_isv_prod_id(::google::protobuf::uint32 value) {
+  set_has_isv_prod_id();
+  isv_prod_id_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.isv_prod_id)
+}
+
+// required uint32 isv_svn = 12;
+inline bool protobuf_sgx_report_body_t::has_isv_svn() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_isv_svn() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_isv_svn() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void protobuf_sgx_report_body_t::clear_isv_svn() {
+  isv_svn_ = 0u;
+  clear_has_isv_svn();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::isv_svn() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.isv_svn)
+  return isv_svn_;
+}
+inline void protobuf_sgx_report_body_t::set_isv_svn(::google::protobuf::uint32 value) {
+  set_has_isv_svn();
+  isv_svn_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.isv_svn)
+}
+
+// repeated uint32 reserved4 = 7 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved4_size() const {
+  return reserved4_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved4() {
+  reserved4_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved4(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved4)
+  return reserved4_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved4(int index, ::google::protobuf::uint32 value) {
+  reserved4_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved4)
+}
+inline void protobuf_sgx_report_body_t::add_reserved4(::google::protobuf::uint32 value) {
+  reserved4_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved4)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved4() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved4)
+  return reserved4_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved4() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved4)
+  return &reserved4_;
+}
+
+// repeated uint32 report_data = 8 [packed = true];
+inline int protobuf_sgx_report_body_t::report_data_size() const {
+  return report_data_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_report_data() {
+  report_data_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::report_data(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.report_data)
+  return report_data_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_report_data(int index, ::google::protobuf::uint32 value) {
+  report_data_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.report_data)
+}
+inline void protobuf_sgx_report_body_t::add_report_data(::google::protobuf::uint32 value) {
+  report_data_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.report_data)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::report_data() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.report_data)
+  return report_data_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_report_data() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.report_data)
+  return &report_data_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_report_t
+
+// required .protobuf_sgx_report_body_t body = 1;
+inline bool protobuf_sgx_report_t::has_body() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_report_t::set_has_body() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_report_t::clear_has_body() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_report_t::clear_body() {
+  if (body_ != NULL) body_->::protobuf_sgx_report_body_t::Clear();
+  clear_has_body();
+}
+inline const ::protobuf_sgx_report_body_t& protobuf_sgx_report_t::body() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.body)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return body_ != NULL ? *body_ : *default_instance().body_;
+#else
+  return body_ != NULL ? *body_ : *default_instance_->body_;
+#endif
+}
+inline ::protobuf_sgx_report_body_t* protobuf_sgx_report_t::mutable_body() {
+  set_has_body();
+  if (body_ == NULL) body_ = new ::protobuf_sgx_report_body_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_report_t.body)
+  return body_;
+}
+inline ::protobuf_sgx_report_body_t* protobuf_sgx_report_t::release_body() {
+  clear_has_body();
+  ::protobuf_sgx_report_body_t* temp = body_;
+  body_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_report_t::set_allocated_body(::protobuf_sgx_report_body_t* body) {
+  delete body_;
+  body_ = body;
+  if (body) {
+    set_has_body();
+  } else {
+    clear_has_body();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_report_t.body)
+}
+
+// repeated uint32 key_id = 2 [packed = true];
+inline int protobuf_sgx_report_t::key_id_size() const {
+  return key_id_.size();
+}
+inline void protobuf_sgx_report_t::clear_key_id() {
+  key_id_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_t::key_id(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.key_id)
+  return key_id_.Get(index);
+}
+inline void protobuf_sgx_report_t::set_key_id(int index, ::google::protobuf::uint32 value) {
+  key_id_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_t.key_id)
+}
+inline void protobuf_sgx_report_t::add_key_id(::google::protobuf::uint32 value) {
+  key_id_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_t.key_id)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_t::key_id() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_t.key_id)
+  return key_id_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_t::mutable_key_id() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_t.key_id)
+  return &key_id_;
+}
+
+// repeated uint32 mac = 3 [packed = true];
+inline int protobuf_sgx_report_t::mac_size() const {
+  return mac_.size();
+}
+inline void protobuf_sgx_report_t::clear_mac() {
+  mac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_t::mac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.mac)
+  return mac_.Get(index);
+}
+inline void protobuf_sgx_report_t::set_mac(int index, ::google::protobuf::uint32 value) {
+  mac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_t.mac)
+}
+inline void protobuf_sgx_report_t::add_mac(::google::protobuf::uint32 value) {
+  mac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_t.mac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_t::mac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_t.mac)
+  return mac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_t::mutable_mac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_t.mac)
+  return &mac_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_target_info_t
+
+// repeated uint32 mr_enclave = 1 [packed = true];
+inline int protobuf_sgx_target_info_t::mr_enclave_size() const {
+  return mr_enclave_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_mr_enclave() {
+  mr_enclave_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::mr_enclave(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.mr_enclave)
+  return mr_enclave_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_mr_enclave(int index, ::google::protobuf::uint32 value) {
+  mr_enclave_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.mr_enclave)
+}
+inline void protobuf_sgx_target_info_t::add_mr_enclave(::google::protobuf::uint32 value) {
+  mr_enclave_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.mr_enclave)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::mr_enclave() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.mr_enclave)
+  return mr_enclave_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_mr_enclave() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.mr_enclave)
+  return &mr_enclave_;
+}
+
+// required .protobuf_sgx_attributes_t attributes = 4;
+inline bool protobuf_sgx_target_info_t::has_attributes() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_target_info_t::set_has_attributes() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_target_info_t::clear_has_attributes() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_target_info_t::clear_attributes() {
+  if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+  clear_has_attributes();
+}
+inline const ::protobuf_sgx_attributes_t& protobuf_sgx_target_info_t::attributes() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.attributes)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return attributes_ != NULL ? *attributes_ : *default_instance().attributes_;
+#else
+  return attributes_ != NULL ? *attributes_ : *default_instance_->attributes_;
+#endif
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_target_info_t::mutable_attributes() {
+  set_has_attributes();
+  if (attributes_ == NULL) attributes_ = new ::protobuf_sgx_attributes_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_target_info_t.attributes)
+  return attributes_;
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_target_info_t::release_attributes() {
+  clear_has_attributes();
+  ::protobuf_sgx_attributes_t* temp = attributes_;
+  attributes_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_target_info_t::set_allocated_attributes(::protobuf_sgx_attributes_t* attributes) {
+  delete attributes_;
+  attributes_ = attributes;
+  if (attributes) {
+    set_has_attributes();
+  } else {
+    clear_has_attributes();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_target_info_t.attributes)
+}
+
+// repeated uint32 reserved1 = 2 [packed = true];
+inline int protobuf_sgx_target_info_t::reserved1_size() const {
+  return reserved1_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_reserved1() {
+  reserved1_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::reserved1(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.reserved1)
+  return reserved1_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_reserved1(int index, ::google::protobuf::uint32 value) {
+  reserved1_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.reserved1)
+}
+inline void protobuf_sgx_target_info_t::add_reserved1(::google::protobuf::uint32 value) {
+  reserved1_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.reserved1)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::reserved1() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.reserved1)
+  return reserved1_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_reserved1() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.reserved1)
+  return &reserved1_;
+}
+
+// required uint32 misc_select = 5;
+inline bool protobuf_sgx_target_info_t::has_misc_select() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void protobuf_sgx_target_info_t::set_has_misc_select() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void protobuf_sgx_target_info_t::clear_has_misc_select() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void protobuf_sgx_target_info_t::clear_misc_select() {
+  misc_select_ = 0u;
+  clear_has_misc_select();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::misc_select() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.misc_select)
+  return misc_select_;
+}
+inline void protobuf_sgx_target_info_t::set_misc_select(::google::protobuf::uint32 value) {
+  set_has_misc_select();
+  misc_select_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.misc_select)
+}
+
+// repeated uint32 reserved2 = 3 [packed = true];
+inline int protobuf_sgx_target_info_t::reserved2_size() const {
+  return reserved2_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_reserved2() {
+  reserved2_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::reserved2(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.reserved2)
+  return reserved2_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_reserved2(int index, ::google::protobuf::uint32 value) {
+  reserved2_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.reserved2)
+}
+inline void protobuf_sgx_target_info_t::add_reserved2(::google::protobuf::uint32 value) {
+  reserved2_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.reserved2)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::reserved2() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.reserved2)
+  return reserved2_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_reserved2() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.reserved2)
+  return &reserved2_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg1_t
+
+// required .protobuf_sgx_ec256_public_t g_a = 1;
+inline bool protobuf_sgx_dh_msg1_t::has_g_a() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg1_t::set_has_g_a() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_has_g_a() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_g_a() {
+  if (g_a_ != NULL) g_a_->::protobuf_sgx_ec256_public_t::Clear();
+  clear_has_g_a();
+}
+inline const ::protobuf_sgx_ec256_public_t& protobuf_sgx_dh_msg1_t::g_a() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg1_t.g_a)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return g_a_ != NULL ? *g_a_ : *default_instance().g_a_;
+#else
+  return g_a_ != NULL ? *g_a_ : *default_instance_->g_a_;
+#endif
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg1_t::mutable_g_a() {
+  set_has_g_a();
+  if (g_a_ == NULL) g_a_ = new ::protobuf_sgx_ec256_public_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg1_t.g_a)
+  return g_a_;
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg1_t::release_g_a() {
+  clear_has_g_a();
+  ::protobuf_sgx_ec256_public_t* temp = g_a_;
+  g_a_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg1_t::set_allocated_g_a(::protobuf_sgx_ec256_public_t* g_a) {
+  delete g_a_;
+  g_a_ = g_a;
+  if (g_a) {
+    set_has_g_a();
+  } else {
+    clear_has_g_a();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg1_t.g_a)
+}
+
+// required .protobuf_sgx_target_info_t target = 2;
+inline bool protobuf_sgx_dh_msg1_t::has_target() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_dh_msg1_t::set_has_target() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_has_target() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_target() {
+  if (target_ != NULL) target_->::protobuf_sgx_target_info_t::Clear();
+  clear_has_target();
+}
+inline const ::protobuf_sgx_target_info_t& protobuf_sgx_dh_msg1_t::target() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg1_t.target)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return target_ != NULL ? *target_ : *default_instance().target_;
+#else
+  return target_ != NULL ? *target_ : *default_instance_->target_;
+#endif
+}
+inline ::protobuf_sgx_target_info_t* protobuf_sgx_dh_msg1_t::mutable_target() {
+  set_has_target();
+  if (target_ == NULL) target_ = new ::protobuf_sgx_target_info_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg1_t.target)
+  return target_;
+}
+inline ::protobuf_sgx_target_info_t* protobuf_sgx_dh_msg1_t::release_target() {
+  clear_has_target();
+  ::protobuf_sgx_target_info_t* temp = target_;
+  target_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg1_t::set_allocated_target(::protobuf_sgx_target_info_t* target) {
+  delete target_;
+  target_ = target;
+  if (target) {
+    set_has_target();
+  } else {
+    clear_has_target();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg1_t.target)
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg2_t
+
+// required .protobuf_sgx_ec256_public_t g_b = 1;
+inline bool protobuf_sgx_dh_msg2_t::has_g_b() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg2_t::set_has_g_b() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_has_g_b() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_g_b() {
+  if (g_b_ != NULL) g_b_->::protobuf_sgx_ec256_public_t::Clear();
+  clear_has_g_b();
+}
+inline const ::protobuf_sgx_ec256_public_t& protobuf_sgx_dh_msg2_t::g_b() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.g_b)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return g_b_ != NULL ? *g_b_ : *default_instance().g_b_;
+#else
+  return g_b_ != NULL ? *g_b_ : *default_instance_->g_b_;
+#endif
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg2_t::mutable_g_b() {
+  set_has_g_b();
+  if (g_b_ == NULL) g_b_ = new ::protobuf_sgx_ec256_public_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg2_t.g_b)
+  return g_b_;
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg2_t::release_g_b() {
+  clear_has_g_b();
+  ::protobuf_sgx_ec256_public_t* temp = g_b_;
+  g_b_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg2_t::set_allocated_g_b(::protobuf_sgx_ec256_public_t* g_b) {
+  delete g_b_;
+  g_b_ = g_b;
+  if (g_b) {
+    set_has_g_b();
+  } else {
+    clear_has_g_b();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg2_t.g_b)
+}
+
+// required .protobuf_sgx_report_t report = 2;
+inline bool protobuf_sgx_dh_msg2_t::has_report() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_dh_msg2_t::set_has_report() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_has_report() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_report() {
+  if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+  clear_has_report();
+}
+inline const ::protobuf_sgx_report_t& protobuf_sgx_dh_msg2_t::report() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.report)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return report_ != NULL ? *report_ : *default_instance().report_;
+#else
+  return report_ != NULL ? *report_ : *default_instance_->report_;
+#endif
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg2_t::mutable_report() {
+  set_has_report();
+  if (report_ == NULL) report_ = new ::protobuf_sgx_report_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg2_t.report)
+  return report_;
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg2_t::release_report() {
+  clear_has_report();
+  ::protobuf_sgx_report_t* temp = report_;
+  report_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg2_t::set_allocated_report(::protobuf_sgx_report_t* report) {
+  delete report_;
+  report_ = report;
+  if (report) {
+    set_has_report();
+  } else {
+    clear_has_report();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg2_t.report)
+}
+
+// repeated uint32 cmac = 3 [packed = true];
+inline int protobuf_sgx_dh_msg2_t::cmac_size() const {
+  return cmac_.size();
+}
+inline void protobuf_sgx_dh_msg2_t::clear_cmac() {
+  cmac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg2_t::cmac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.cmac)
+  return cmac_.Get(index);
+}
+inline void protobuf_sgx_dh_msg2_t::set_cmac(int index, ::google::protobuf::uint32 value) {
+  cmac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg2_t.cmac)
+}
+inline void protobuf_sgx_dh_msg2_t::add_cmac(::google::protobuf::uint32 value) {
+  cmac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg2_t.cmac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg2_t::cmac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg2_t.cmac)
+  return cmac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg2_t::mutable_cmac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg2_t.cmac)
+  return &cmac_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg3_body_t
+
+// required .protobuf_sgx_report_t report = 1;
+inline bool protobuf_sgx_dh_msg3_body_t::has_report() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_has_report() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_has_report() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_report() {
+  if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+  clear_has_report();
+}
+inline const ::protobuf_sgx_report_t& protobuf_sgx_dh_msg3_body_t::report() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_body_t.report)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return report_ != NULL ? *report_ : *default_instance().report_;
+#else
+  return report_ != NULL ? *report_ : *default_instance_->report_;
+#endif
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg3_body_t::mutable_report() {
+  set_has_report();
+  if (report_ == NULL) report_ = new ::protobuf_sgx_report_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg3_body_t.report)
+  return report_;
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg3_body_t::release_report() {
+  clear_has_report();
+  ::protobuf_sgx_report_t* temp = report_;
+  report_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_allocated_report(::protobuf_sgx_report_t* report) {
+  delete report_;
+  report_ = report;
+  if (report) {
+    set_has_report();
+  } else {
+    clear_has_report();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg3_body_t.report)
+}
+
+// repeated uint32 additional_prop = 2;
+inline int protobuf_sgx_dh_msg3_body_t::additional_prop_size() const {
+  return additional_prop_.size();
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_additional_prop() {
+  additional_prop_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg3_body_t::additional_prop(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return additional_prop_.Get(index);
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_additional_prop(int index, ::google::protobuf::uint32 value) {
+  additional_prop_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg3_body_t.additional_prop)
+}
+inline void protobuf_sgx_dh_msg3_body_t::add_additional_prop(::google::protobuf::uint32 value) {
+  additional_prop_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg3_body_t.additional_prop)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg3_body_t::additional_prop() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return additional_prop_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg3_body_t::mutable_additional_prop() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return &additional_prop_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg3_t
+
+// required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+inline bool protobuf_sgx_dh_msg3_t::has_msg3_body() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg3_t::set_has_msg3_body() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_t::clear_has_msg3_body() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_t::clear_msg3_body() {
+  if (msg3_body_ != NULL) msg3_body_->::protobuf_sgx_dh_msg3_body_t::Clear();
+  clear_has_msg3_body();
+}
+inline const ::protobuf_sgx_dh_msg3_body_t& protobuf_sgx_dh_msg3_t::msg3_body() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_t.msg3_body)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return msg3_body_ != NULL ? *msg3_body_ : *default_instance().msg3_body_;
+#else
+  return msg3_body_ != NULL ? *msg3_body_ : *default_instance_->msg3_body_;
+#endif
+}
+inline ::protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_t::mutable_msg3_body() {
+  set_has_msg3_body();
+  if (msg3_body_ == NULL) msg3_body_ = new ::protobuf_sgx_dh_msg3_body_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg3_t.msg3_body)
+  return msg3_body_;
+}
+inline ::protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_t::release_msg3_body() {
+  clear_has_msg3_body();
+  ::protobuf_sgx_dh_msg3_body_t* temp = msg3_body_;
+  msg3_body_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg3_t::set_allocated_msg3_body(::protobuf_sgx_dh_msg3_body_t* msg3_body) {
+  delete msg3_body_;
+  msg3_body_ = msg3_body;
+  if (msg3_body) {
+    set_has_msg3_body();
+  } else {
+    clear_has_msg3_body();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg3_t.msg3_body)
+}
+
+// repeated uint32 cmac = 2 [packed = true];
+inline int protobuf_sgx_dh_msg3_t::cmac_size() const {
+  return cmac_.size();
+}
+inline void protobuf_sgx_dh_msg3_t::clear_cmac() {
+  cmac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg3_t::cmac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_t.cmac)
+  return cmac_.Get(index);
+}
+inline void protobuf_sgx_dh_msg3_t::set_cmac(int index, ::google::protobuf::uint32 value) {
+  cmac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg3_t.cmac)
+}
+inline void protobuf_sgx_dh_msg3_t::add_cmac(::google::protobuf::uint32 value) {
+  cmac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg3_t.cmac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg3_t::cmac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg3_t.cmac)
+  return cmac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg3_t::mutable_cmac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg3_t.cmac)
+  return &cmac_;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_dhmsgs_2eproto__INCLUDED

+ 2324 - 0
include/ProtobufLAMessages.pb.h

@@ -0,0 +1,2324 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ProtobufLAMessages.proto
+
+#ifndef PROTOBUF_ProtobufLAMessages_2eproto__INCLUDED
+#define PROTOBUF_ProtobufLAMessages_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2006000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message_lite.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+// @@protoc_insertion_point(includes)
+
+// Internal implementation detail -- do not call these.
+void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+class protobuf_sgx_attributes_t;
+class protobuf_sgx_ec256_public_t;
+class protobuf_sgx_report_body_t;
+class protobuf_sgx_report_t;
+class protobuf_sgx_target_info_t;
+class protobuf_sgx_dh_msg1_t;
+class protobuf_sgx_dh_msg2_t;
+class protobuf_sgx_dh_msg3_body_t;
+class protobuf_sgx_dh_msg3_t;
+
+// ===================================================================
+
+class protobuf_sgx_attributes_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_attributes_t();
+  virtual ~protobuf_sgx_attributes_t();
+
+  protobuf_sgx_attributes_t(const protobuf_sgx_attributes_t& from);
+
+  inline protobuf_sgx_attributes_t& operator=(const protobuf_sgx_attributes_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_attributes_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_attributes_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_attributes_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_attributes_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_attributes_t& from);
+  void MergeFrom(const protobuf_sgx_attributes_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required uint64 flags = 1;
+  inline bool has_flags() const;
+  inline void clear_flags();
+  static const int kFlagsFieldNumber = 1;
+  inline ::google::protobuf::uint64 flags() const;
+  inline void set_flags(::google::protobuf::uint64 value);
+
+  // required uint64 xfrm = 2;
+  inline bool has_xfrm() const;
+  inline void clear_xfrm();
+  static const int kXfrmFieldNumber = 2;
+  inline ::google::protobuf::uint64 xfrm() const;
+  inline void set_xfrm(::google::protobuf::uint64 value);
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_attributes_t)
+ private:
+  inline void set_has_flags();
+  inline void clear_has_flags();
+  inline void set_has_xfrm();
+  inline void clear_has_xfrm();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::uint64 flags_;
+  ::google::protobuf::uint64 xfrm_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_attributes_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_ec256_public_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_ec256_public_t();
+  virtual ~protobuf_sgx_ec256_public_t();
+
+  protobuf_sgx_ec256_public_t(const protobuf_sgx_ec256_public_t& from);
+
+  inline protobuf_sgx_ec256_public_t& operator=(const protobuf_sgx_ec256_public_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_ec256_public_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_ec256_public_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_ec256_public_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_ec256_public_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_ec256_public_t& from);
+  void MergeFrom(const protobuf_sgx_ec256_public_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 gx = 1 [packed = true];
+  inline int gx_size() const;
+  inline void clear_gx();
+  static const int kGxFieldNumber = 1;
+  inline ::google::protobuf::uint32 gx(int index) const;
+  inline void set_gx(int index, ::google::protobuf::uint32 value);
+  inline void add_gx(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      gx() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_gx();
+
+  // repeated uint32 gy = 2 [packed = true];
+  inline int gy_size() const;
+  inline void clear_gy();
+  static const int kGyFieldNumber = 2;
+  inline ::google::protobuf::uint32 gy(int index) const;
+  inline void set_gy(int index, ::google::protobuf::uint32 value);
+  inline void add_gy(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      gy() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_gy();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_ec256_public_t)
+ private:
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > gx_;
+  mutable int _gx_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > gy_;
+  mutable int _gy_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_ec256_public_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_report_body_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_report_body_t();
+  virtual ~protobuf_sgx_report_body_t();
+
+  protobuf_sgx_report_body_t(const protobuf_sgx_report_body_t& from);
+
+  inline protobuf_sgx_report_body_t& operator=(const protobuf_sgx_report_body_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_report_body_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_report_body_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_report_body_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_report_body_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_report_body_t& from);
+  void MergeFrom(const protobuf_sgx_report_body_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 cpu_svn = 1 [packed = true];
+  inline int cpu_svn_size() const;
+  inline void clear_cpu_svn();
+  static const int kCpuSvnFieldNumber = 1;
+  inline ::google::protobuf::uint32 cpu_svn(int index) const;
+  inline void set_cpu_svn(int index, ::google::protobuf::uint32 value);
+  inline void add_cpu_svn(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cpu_svn() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cpu_svn();
+
+  // required uint32 misc_select = 9;
+  inline bool has_misc_select() const;
+  inline void clear_misc_select();
+  static const int kMiscSelectFieldNumber = 9;
+  inline ::google::protobuf::uint32 misc_select() const;
+  inline void set_misc_select(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  inline int reserved1_size() const;
+  inline void clear_reserved1();
+  static const int kReserved1FieldNumber = 2;
+  inline ::google::protobuf::uint32 reserved1(int index) const;
+  inline void set_reserved1(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved1(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved1() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved1();
+
+  // required .protobuf_sgx_attributes_t attributes = 10;
+  inline bool has_attributes() const;
+  inline void clear_attributes();
+  static const int kAttributesFieldNumber = 10;
+  inline const ::protobuf_sgx_attributes_t& attributes() const;
+  inline ::protobuf_sgx_attributes_t* mutable_attributes();
+  inline ::protobuf_sgx_attributes_t* release_attributes();
+  inline void set_allocated_attributes(::protobuf_sgx_attributes_t* attributes);
+
+  // repeated uint32 mr_enclave = 3 [packed = true];
+  inline int mr_enclave_size() const;
+  inline void clear_mr_enclave();
+  static const int kMrEnclaveFieldNumber = 3;
+  inline ::google::protobuf::uint32 mr_enclave(int index) const;
+  inline void set_mr_enclave(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_enclave(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_enclave() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_enclave();
+
+  // repeated uint32 reserved2 = 4 [packed = true];
+  inline int reserved2_size() const;
+  inline void clear_reserved2();
+  static const int kReserved2FieldNumber = 4;
+  inline ::google::protobuf::uint32 reserved2(int index) const;
+  inline void set_reserved2(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved2(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved2() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved2();
+
+  // repeated uint32 mr_signer = 5 [packed = true];
+  inline int mr_signer_size() const;
+  inline void clear_mr_signer();
+  static const int kMrSignerFieldNumber = 5;
+  inline ::google::protobuf::uint32 mr_signer(int index) const;
+  inline void set_mr_signer(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_signer(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_signer() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_signer();
+
+  // repeated uint32 reserved3 = 6 [packed = true];
+  inline int reserved3_size() const;
+  inline void clear_reserved3();
+  static const int kReserved3FieldNumber = 6;
+  inline ::google::protobuf::uint32 reserved3(int index) const;
+  inline void set_reserved3(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved3(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved3() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved3();
+
+  // required uint32 isv_prod_id = 11;
+  inline bool has_isv_prod_id() const;
+  inline void clear_isv_prod_id();
+  static const int kIsvProdIdFieldNumber = 11;
+  inline ::google::protobuf::uint32 isv_prod_id() const;
+  inline void set_isv_prod_id(::google::protobuf::uint32 value);
+
+  // required uint32 isv_svn = 12;
+  inline bool has_isv_svn() const;
+  inline void clear_isv_svn();
+  static const int kIsvSvnFieldNumber = 12;
+  inline ::google::protobuf::uint32 isv_svn() const;
+  inline void set_isv_svn(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved4 = 7 [packed = true];
+  inline int reserved4_size() const;
+  inline void clear_reserved4();
+  static const int kReserved4FieldNumber = 7;
+  inline ::google::protobuf::uint32 reserved4(int index) const;
+  inline void set_reserved4(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved4(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved4() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved4();
+
+  // repeated uint32 report_data = 8 [packed = true];
+  inline int report_data_size() const;
+  inline void clear_report_data();
+  static const int kReportDataFieldNumber = 8;
+  inline ::google::protobuf::uint32 report_data(int index) const;
+  inline void set_report_data(int index, ::google::protobuf::uint32 value);
+  inline void add_report_data(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      report_data() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_report_data();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_report_body_t)
+ private:
+  inline void set_has_misc_select();
+  inline void clear_has_misc_select();
+  inline void set_has_attributes();
+  inline void clear_has_attributes();
+  inline void set_has_isv_prod_id();
+  inline void clear_has_isv_prod_id();
+  inline void set_has_isv_svn();
+  inline void clear_has_isv_svn();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cpu_svn_;
+  mutable int _cpu_svn_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved1_;
+  mutable int _reserved1_cached_byte_size_;
+  ::protobuf_sgx_attributes_t* attributes_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_enclave_;
+  mutable int _mr_enclave_cached_byte_size_;
+  ::google::protobuf::uint32 misc_select_;
+  ::google::protobuf::uint32 isv_prod_id_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved2_;
+  mutable int _reserved2_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_signer_;
+  mutable int _mr_signer_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved3_;
+  mutable int _reserved3_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved4_;
+  mutable int _reserved4_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > report_data_;
+  mutable int _report_data_cached_byte_size_;
+  ::google::protobuf::uint32 isv_svn_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_report_body_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_report_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_report_t();
+  virtual ~protobuf_sgx_report_t();
+
+  protobuf_sgx_report_t(const protobuf_sgx_report_t& from);
+
+  inline protobuf_sgx_report_t& operator=(const protobuf_sgx_report_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_report_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_report_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_report_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_report_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_report_t& from);
+  void MergeFrom(const protobuf_sgx_report_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_report_body_t body = 1;
+  inline bool has_body() const;
+  inline void clear_body();
+  static const int kBodyFieldNumber = 1;
+  inline const ::protobuf_sgx_report_body_t& body() const;
+  inline ::protobuf_sgx_report_body_t* mutable_body();
+  inline ::protobuf_sgx_report_body_t* release_body();
+  inline void set_allocated_body(::protobuf_sgx_report_body_t* body);
+
+  // repeated uint32 key_id = 2 [packed = true];
+  inline int key_id_size() const;
+  inline void clear_key_id();
+  static const int kKeyIdFieldNumber = 2;
+  inline ::google::protobuf::uint32 key_id(int index) const;
+  inline void set_key_id(int index, ::google::protobuf::uint32 value);
+  inline void add_key_id(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      key_id() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_key_id();
+
+  // repeated uint32 mac = 3 [packed = true];
+  inline int mac_size() const;
+  inline void clear_mac();
+  static const int kMacFieldNumber = 3;
+  inline ::google::protobuf::uint32 mac(int index) const;
+  inline void set_mac(int index, ::google::protobuf::uint32 value);
+  inline void add_mac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_report_t)
+ private:
+  inline void set_has_body();
+  inline void clear_has_body();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_report_body_t* body_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > key_id_;
+  mutable int _key_id_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mac_;
+  mutable int _mac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_report_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_target_info_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_target_info_t();
+  virtual ~protobuf_sgx_target_info_t();
+
+  protobuf_sgx_target_info_t(const protobuf_sgx_target_info_t& from);
+
+  inline protobuf_sgx_target_info_t& operator=(const protobuf_sgx_target_info_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_target_info_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_target_info_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_target_info_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_target_info_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_target_info_t& from);
+  void MergeFrom(const protobuf_sgx_target_info_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // repeated uint32 mr_enclave = 1 [packed = true];
+  inline int mr_enclave_size() const;
+  inline void clear_mr_enclave();
+  static const int kMrEnclaveFieldNumber = 1;
+  inline ::google::protobuf::uint32 mr_enclave(int index) const;
+  inline void set_mr_enclave(int index, ::google::protobuf::uint32 value);
+  inline void add_mr_enclave(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      mr_enclave() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_mr_enclave();
+
+  // required .protobuf_sgx_attributes_t attributes = 4;
+  inline bool has_attributes() const;
+  inline void clear_attributes();
+  static const int kAttributesFieldNumber = 4;
+  inline const ::protobuf_sgx_attributes_t& attributes() const;
+  inline ::protobuf_sgx_attributes_t* mutable_attributes();
+  inline ::protobuf_sgx_attributes_t* release_attributes();
+  inline void set_allocated_attributes(::protobuf_sgx_attributes_t* attributes);
+
+  // repeated uint32 reserved1 = 2 [packed = true];
+  inline int reserved1_size() const;
+  inline void clear_reserved1();
+  static const int kReserved1FieldNumber = 2;
+  inline ::google::protobuf::uint32 reserved1(int index) const;
+  inline void set_reserved1(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved1(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved1() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved1();
+
+  // required uint32 misc_select = 5;
+  inline bool has_misc_select() const;
+  inline void clear_misc_select();
+  static const int kMiscSelectFieldNumber = 5;
+  inline ::google::protobuf::uint32 misc_select() const;
+  inline void set_misc_select(::google::protobuf::uint32 value);
+
+  // repeated uint32 reserved2 = 3 [packed = true];
+  inline int reserved2_size() const;
+  inline void clear_reserved2();
+  static const int kReserved2FieldNumber = 3;
+  inline ::google::protobuf::uint32 reserved2(int index) const;
+  inline void set_reserved2(int index, ::google::protobuf::uint32 value);
+  inline void add_reserved2(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      reserved2() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_reserved2();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_target_info_t)
+ private:
+  inline void set_has_attributes();
+  inline void clear_has_attributes();
+  inline void set_has_misc_select();
+  inline void clear_has_misc_select();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > mr_enclave_;
+  mutable int _mr_enclave_cached_byte_size_;
+  ::protobuf_sgx_attributes_t* attributes_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved1_;
+  mutable int _reserved1_cached_byte_size_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > reserved2_;
+  mutable int _reserved2_cached_byte_size_;
+  ::google::protobuf::uint32 misc_select_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_target_info_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg1_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg1_t();
+  virtual ~protobuf_sgx_dh_msg1_t();
+
+  protobuf_sgx_dh_msg1_t(const protobuf_sgx_dh_msg1_t& from);
+
+  inline protobuf_sgx_dh_msg1_t& operator=(const protobuf_sgx_dh_msg1_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg1_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg1_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg1_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg1_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg1_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg1_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_ec256_public_t g_a = 1;
+  inline bool has_g_a() const;
+  inline void clear_g_a();
+  static const int kGAFieldNumber = 1;
+  inline const ::protobuf_sgx_ec256_public_t& g_a() const;
+  inline ::protobuf_sgx_ec256_public_t* mutable_g_a();
+  inline ::protobuf_sgx_ec256_public_t* release_g_a();
+  inline void set_allocated_g_a(::protobuf_sgx_ec256_public_t* g_a);
+
+  // required .protobuf_sgx_target_info_t target = 2;
+  inline bool has_target() const;
+  inline void clear_target();
+  static const int kTargetFieldNumber = 2;
+  inline const ::protobuf_sgx_target_info_t& target() const;
+  inline ::protobuf_sgx_target_info_t* mutable_target();
+  inline ::protobuf_sgx_target_info_t* release_target();
+  inline void set_allocated_target(::protobuf_sgx_target_info_t* target);
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg1_t)
+ private:
+  inline void set_has_g_a();
+  inline void clear_has_g_a();
+  inline void set_has_target();
+  inline void clear_has_target();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_ec256_public_t* g_a_;
+  ::protobuf_sgx_target_info_t* target_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg1_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg2_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg2_t();
+  virtual ~protobuf_sgx_dh_msg2_t();
+
+  protobuf_sgx_dh_msg2_t(const protobuf_sgx_dh_msg2_t& from);
+
+  inline protobuf_sgx_dh_msg2_t& operator=(const protobuf_sgx_dh_msg2_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg2_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg2_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg2_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg2_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg2_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg2_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_ec256_public_t g_b = 1;
+  inline bool has_g_b() const;
+  inline void clear_g_b();
+  static const int kGBFieldNumber = 1;
+  inline const ::protobuf_sgx_ec256_public_t& g_b() const;
+  inline ::protobuf_sgx_ec256_public_t* mutable_g_b();
+  inline ::protobuf_sgx_ec256_public_t* release_g_b();
+  inline void set_allocated_g_b(::protobuf_sgx_ec256_public_t* g_b);
+
+  // required .protobuf_sgx_report_t report = 2;
+  inline bool has_report() const;
+  inline void clear_report();
+  static const int kReportFieldNumber = 2;
+  inline const ::protobuf_sgx_report_t& report() const;
+  inline ::protobuf_sgx_report_t* mutable_report();
+  inline ::protobuf_sgx_report_t* release_report();
+  inline void set_allocated_report(::protobuf_sgx_report_t* report);
+
+  // repeated uint32 cmac = 3 [packed = true];
+  inline int cmac_size() const;
+  inline void clear_cmac();
+  static const int kCmacFieldNumber = 3;
+  inline ::google::protobuf::uint32 cmac(int index) const;
+  inline void set_cmac(int index, ::google::protobuf::uint32 value);
+  inline void add_cmac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cmac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cmac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg2_t)
+ private:
+  inline void set_has_g_b();
+  inline void clear_has_g_b();
+  inline void set_has_report();
+  inline void clear_has_report();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_ec256_public_t* g_b_;
+  ::protobuf_sgx_report_t* report_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cmac_;
+  mutable int _cmac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg2_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg3_body_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg3_body_t();
+  virtual ~protobuf_sgx_dh_msg3_body_t();
+
+  protobuf_sgx_dh_msg3_body_t(const protobuf_sgx_dh_msg3_body_t& from);
+
+  inline protobuf_sgx_dh_msg3_body_t& operator=(const protobuf_sgx_dh_msg3_body_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg3_body_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg3_body_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg3_body_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg3_body_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg3_body_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg3_body_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_report_t report = 1;
+  inline bool has_report() const;
+  inline void clear_report();
+  static const int kReportFieldNumber = 1;
+  inline const ::protobuf_sgx_report_t& report() const;
+  inline ::protobuf_sgx_report_t* mutable_report();
+  inline ::protobuf_sgx_report_t* release_report();
+  inline void set_allocated_report(::protobuf_sgx_report_t* report);
+
+  // repeated uint32 additional_prop = 2;
+  inline int additional_prop_size() const;
+  inline void clear_additional_prop();
+  static const int kAdditionalPropFieldNumber = 2;
+  inline ::google::protobuf::uint32 additional_prop(int index) const;
+  inline void set_additional_prop(int index, ::google::protobuf::uint32 value);
+  inline void add_additional_prop(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      additional_prop() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_additional_prop();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg3_body_t)
+ private:
+  inline void set_has_report();
+  inline void clear_has_report();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_report_t* report_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > additional_prop_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg3_body_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_sgx_dh_msg3_t : public ::google::protobuf::MessageLite {
+ public:
+  protobuf_sgx_dh_msg3_t();
+  virtual ~protobuf_sgx_dh_msg3_t();
+
+  protobuf_sgx_dh_msg3_t(const protobuf_sgx_dh_msg3_t& from);
+
+  inline protobuf_sgx_dh_msg3_t& operator=(const protobuf_sgx_dh_msg3_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::std::string& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::std::string* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const protobuf_sgx_dh_msg3_t& default_instance();
+
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  // Returns the internal default instance pointer. This function can
+  // return NULL thus should not be used by the user. This is intended
+  // for Protobuf internal code. Please use default_instance() declared
+  // above instead.
+  static inline const protobuf_sgx_dh_msg3_t* internal_default_instance() {
+    return default_instance_;
+  }
+  #endif
+
+  void Swap(protobuf_sgx_dh_msg3_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_dh_msg3_t* New() const;
+  void CheckTypeAndMergeFrom(const ::google::protobuf::MessageLite& from);
+  void CopyFrom(const protobuf_sgx_dh_msg3_t& from);
+  void MergeFrom(const protobuf_sgx_dh_msg3_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  void DiscardUnknownFields();
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::std::string GetTypeName() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+  inline bool has_msg3_body() const;
+  inline void clear_msg3_body();
+  static const int kMsg3BodyFieldNumber = 1;
+  inline const ::protobuf_sgx_dh_msg3_body_t& msg3_body() const;
+  inline ::protobuf_sgx_dh_msg3_body_t* mutable_msg3_body();
+  inline ::protobuf_sgx_dh_msg3_body_t* release_msg3_body();
+  inline void set_allocated_msg3_body(::protobuf_sgx_dh_msg3_body_t* msg3_body);
+
+  // repeated uint32 cmac = 2 [packed = true];
+  inline int cmac_size() const;
+  inline void clear_cmac();
+  static const int kCmacFieldNumber = 2;
+  inline ::google::protobuf::uint32 cmac(int index) const;
+  inline void set_cmac(int index, ::google::protobuf::uint32 value);
+  inline void add_cmac(::google::protobuf::uint32 value);
+  inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+      cmac() const;
+  inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+      mutable_cmac();
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_dh_msg3_t)
+ private:
+  inline void set_has_msg3_body();
+  inline void clear_has_msg3_body();
+
+  ::std::string _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_dh_msg3_body_t* msg3_body_;
+  ::google::protobuf::RepeatedField< ::google::protobuf::uint32 > cmac_;
+  mutable int _cmac_cached_byte_size_;
+  #ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto_impl();
+  #else
+  friend void  protobuf_AddDesc_ProtobufLAMessages_2eproto();
+  #endif
+  friend void protobuf_AssignDesc_ProtobufLAMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufLAMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_dh_msg3_t* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// protobuf_sgx_attributes_t
+
+// required uint64 flags = 1;
+inline bool protobuf_sgx_attributes_t::has_flags() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_attributes_t::set_has_flags() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_attributes_t::clear_has_flags() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_attributes_t::clear_flags() {
+  flags_ = GOOGLE_ULONGLONG(0);
+  clear_has_flags();
+}
+inline ::google::protobuf::uint64 protobuf_sgx_attributes_t::flags() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_attributes_t.flags)
+  return flags_;
+}
+inline void protobuf_sgx_attributes_t::set_flags(::google::protobuf::uint64 value) {
+  set_has_flags();
+  flags_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_attributes_t.flags)
+}
+
+// required uint64 xfrm = 2;
+inline bool protobuf_sgx_attributes_t::has_xfrm() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_attributes_t::set_has_xfrm() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_attributes_t::clear_has_xfrm() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_attributes_t::clear_xfrm() {
+  xfrm_ = GOOGLE_ULONGLONG(0);
+  clear_has_xfrm();
+}
+inline ::google::protobuf::uint64 protobuf_sgx_attributes_t::xfrm() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_attributes_t.xfrm)
+  return xfrm_;
+}
+inline void protobuf_sgx_attributes_t::set_xfrm(::google::protobuf::uint64 value) {
+  set_has_xfrm();
+  xfrm_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_attributes_t.xfrm)
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_ec256_public_t
+
+// repeated uint32 gx = 1 [packed = true];
+inline int protobuf_sgx_ec256_public_t::gx_size() const {
+  return gx_.size();
+}
+inline void protobuf_sgx_ec256_public_t::clear_gx() {
+  gx_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_ec256_public_t::gx(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_ec256_public_t.gx)
+  return gx_.Get(index);
+}
+inline void protobuf_sgx_ec256_public_t::set_gx(int index, ::google::protobuf::uint32 value) {
+  gx_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_ec256_public_t.gx)
+}
+inline void protobuf_sgx_ec256_public_t::add_gx(::google::protobuf::uint32 value) {
+  gx_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_ec256_public_t.gx)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_ec256_public_t::gx() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_ec256_public_t.gx)
+  return gx_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_ec256_public_t::mutable_gx() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_ec256_public_t.gx)
+  return &gx_;
+}
+
+// repeated uint32 gy = 2 [packed = true];
+inline int protobuf_sgx_ec256_public_t::gy_size() const {
+  return gy_.size();
+}
+inline void protobuf_sgx_ec256_public_t::clear_gy() {
+  gy_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_ec256_public_t::gy(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_ec256_public_t.gy)
+  return gy_.Get(index);
+}
+inline void protobuf_sgx_ec256_public_t::set_gy(int index, ::google::protobuf::uint32 value) {
+  gy_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_ec256_public_t.gy)
+}
+inline void protobuf_sgx_ec256_public_t::add_gy(::google::protobuf::uint32 value) {
+  gy_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_ec256_public_t.gy)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_ec256_public_t::gy() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_ec256_public_t.gy)
+  return gy_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_ec256_public_t::mutable_gy() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_ec256_public_t.gy)
+  return &gy_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_report_body_t
+
+// repeated uint32 cpu_svn = 1 [packed = true];
+inline int protobuf_sgx_report_body_t::cpu_svn_size() const {
+  return cpu_svn_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_cpu_svn() {
+  cpu_svn_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::cpu_svn(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.cpu_svn)
+  return cpu_svn_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_cpu_svn(int index, ::google::protobuf::uint32 value) {
+  cpu_svn_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.cpu_svn)
+}
+inline void protobuf_sgx_report_body_t::add_cpu_svn(::google::protobuf::uint32 value) {
+  cpu_svn_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.cpu_svn)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::cpu_svn() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.cpu_svn)
+  return cpu_svn_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_cpu_svn() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.cpu_svn)
+  return &cpu_svn_;
+}
+
+// required uint32 misc_select = 9;
+inline bool protobuf_sgx_report_body_t::has_misc_select() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_misc_select() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_misc_select() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_report_body_t::clear_misc_select() {
+  misc_select_ = 0u;
+  clear_has_misc_select();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::misc_select() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.misc_select)
+  return misc_select_;
+}
+inline void protobuf_sgx_report_body_t::set_misc_select(::google::protobuf::uint32 value) {
+  set_has_misc_select();
+  misc_select_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.misc_select)
+}
+
+// repeated uint32 reserved1 = 2 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved1_size() const {
+  return reserved1_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved1() {
+  reserved1_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved1(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved1)
+  return reserved1_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved1(int index, ::google::protobuf::uint32 value) {
+  reserved1_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved1)
+}
+inline void protobuf_sgx_report_body_t::add_reserved1(::google::protobuf::uint32 value) {
+  reserved1_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved1)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved1() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved1)
+  return reserved1_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved1() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved1)
+  return &reserved1_;
+}
+
+// required .protobuf_sgx_attributes_t attributes = 10;
+inline bool protobuf_sgx_report_body_t::has_attributes() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_attributes() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_attributes() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void protobuf_sgx_report_body_t::clear_attributes() {
+  if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+  clear_has_attributes();
+}
+inline const ::protobuf_sgx_attributes_t& protobuf_sgx_report_body_t::attributes() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.attributes)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return attributes_ != NULL ? *attributes_ : *default_instance().attributes_;
+#else
+  return attributes_ != NULL ? *attributes_ : *default_instance_->attributes_;
+#endif
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_report_body_t::mutable_attributes() {
+  set_has_attributes();
+  if (attributes_ == NULL) attributes_ = new ::protobuf_sgx_attributes_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_report_body_t.attributes)
+  return attributes_;
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_report_body_t::release_attributes() {
+  clear_has_attributes();
+  ::protobuf_sgx_attributes_t* temp = attributes_;
+  attributes_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_report_body_t::set_allocated_attributes(::protobuf_sgx_attributes_t* attributes) {
+  delete attributes_;
+  attributes_ = attributes;
+  if (attributes) {
+    set_has_attributes();
+  } else {
+    clear_has_attributes();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_report_body_t.attributes)
+}
+
+// repeated uint32 mr_enclave = 3 [packed = true];
+inline int protobuf_sgx_report_body_t::mr_enclave_size() const {
+  return mr_enclave_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_mr_enclave() {
+  mr_enclave_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::mr_enclave(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.mr_enclave)
+  return mr_enclave_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_mr_enclave(int index, ::google::protobuf::uint32 value) {
+  mr_enclave_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.mr_enclave)
+}
+inline void protobuf_sgx_report_body_t::add_mr_enclave(::google::protobuf::uint32 value) {
+  mr_enclave_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.mr_enclave)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::mr_enclave() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.mr_enclave)
+  return mr_enclave_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_mr_enclave() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.mr_enclave)
+  return &mr_enclave_;
+}
+
+// repeated uint32 reserved2 = 4 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved2_size() const {
+  return reserved2_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved2() {
+  reserved2_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved2(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved2)
+  return reserved2_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved2(int index, ::google::protobuf::uint32 value) {
+  reserved2_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved2)
+}
+inline void protobuf_sgx_report_body_t::add_reserved2(::google::protobuf::uint32 value) {
+  reserved2_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved2)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved2() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved2)
+  return reserved2_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved2() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved2)
+  return &reserved2_;
+}
+
+// repeated uint32 mr_signer = 5 [packed = true];
+inline int protobuf_sgx_report_body_t::mr_signer_size() const {
+  return mr_signer_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_mr_signer() {
+  mr_signer_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::mr_signer(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.mr_signer)
+  return mr_signer_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_mr_signer(int index, ::google::protobuf::uint32 value) {
+  mr_signer_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.mr_signer)
+}
+inline void protobuf_sgx_report_body_t::add_mr_signer(::google::protobuf::uint32 value) {
+  mr_signer_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.mr_signer)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::mr_signer() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.mr_signer)
+  return mr_signer_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_mr_signer() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.mr_signer)
+  return &mr_signer_;
+}
+
+// repeated uint32 reserved3 = 6 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved3_size() const {
+  return reserved3_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved3() {
+  reserved3_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved3(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved3)
+  return reserved3_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved3(int index, ::google::protobuf::uint32 value) {
+  reserved3_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved3)
+}
+inline void protobuf_sgx_report_body_t::add_reserved3(::google::protobuf::uint32 value) {
+  reserved3_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved3)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved3() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved3)
+  return reserved3_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved3() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved3)
+  return &reserved3_;
+}
+
+// required uint32 isv_prod_id = 11;
+inline bool protobuf_sgx_report_body_t::has_isv_prod_id() const {
+  return (_has_bits_[0] & 0x00000100u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_isv_prod_id() {
+  _has_bits_[0] |= 0x00000100u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_isv_prod_id() {
+  _has_bits_[0] &= ~0x00000100u;
+}
+inline void protobuf_sgx_report_body_t::clear_isv_prod_id() {
+  isv_prod_id_ = 0u;
+  clear_has_isv_prod_id();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::isv_prod_id() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.isv_prod_id)
+  return isv_prod_id_;
+}
+inline void protobuf_sgx_report_body_t::set_isv_prod_id(::google::protobuf::uint32 value) {
+  set_has_isv_prod_id();
+  isv_prod_id_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.isv_prod_id)
+}
+
+// required uint32 isv_svn = 12;
+inline bool protobuf_sgx_report_body_t::has_isv_svn() const {
+  return (_has_bits_[0] & 0x00000200u) != 0;
+}
+inline void protobuf_sgx_report_body_t::set_has_isv_svn() {
+  _has_bits_[0] |= 0x00000200u;
+}
+inline void protobuf_sgx_report_body_t::clear_has_isv_svn() {
+  _has_bits_[0] &= ~0x00000200u;
+}
+inline void protobuf_sgx_report_body_t::clear_isv_svn() {
+  isv_svn_ = 0u;
+  clear_has_isv_svn();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::isv_svn() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.isv_svn)
+  return isv_svn_;
+}
+inline void protobuf_sgx_report_body_t::set_isv_svn(::google::protobuf::uint32 value) {
+  set_has_isv_svn();
+  isv_svn_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.isv_svn)
+}
+
+// repeated uint32 reserved4 = 7 [packed = true];
+inline int protobuf_sgx_report_body_t::reserved4_size() const {
+  return reserved4_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_reserved4() {
+  reserved4_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::reserved4(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.reserved4)
+  return reserved4_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_reserved4(int index, ::google::protobuf::uint32 value) {
+  reserved4_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.reserved4)
+}
+inline void protobuf_sgx_report_body_t::add_reserved4(::google::protobuf::uint32 value) {
+  reserved4_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.reserved4)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::reserved4() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.reserved4)
+  return reserved4_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_reserved4() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.reserved4)
+  return &reserved4_;
+}
+
+// repeated uint32 report_data = 8 [packed = true];
+inline int protobuf_sgx_report_body_t::report_data_size() const {
+  return report_data_.size();
+}
+inline void protobuf_sgx_report_body_t::clear_report_data() {
+  report_data_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_body_t::report_data(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_body_t.report_data)
+  return report_data_.Get(index);
+}
+inline void protobuf_sgx_report_body_t::set_report_data(int index, ::google::protobuf::uint32 value) {
+  report_data_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_body_t.report_data)
+}
+inline void protobuf_sgx_report_body_t::add_report_data(::google::protobuf::uint32 value) {
+  report_data_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_body_t.report_data)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_body_t::report_data() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_body_t.report_data)
+  return report_data_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_body_t::mutable_report_data() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_body_t.report_data)
+  return &report_data_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_report_t
+
+// required .protobuf_sgx_report_body_t body = 1;
+inline bool protobuf_sgx_report_t::has_body() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_report_t::set_has_body() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_report_t::clear_has_body() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_report_t::clear_body() {
+  if (body_ != NULL) body_->::protobuf_sgx_report_body_t::Clear();
+  clear_has_body();
+}
+inline const ::protobuf_sgx_report_body_t& protobuf_sgx_report_t::body() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.body)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return body_ != NULL ? *body_ : *default_instance().body_;
+#else
+  return body_ != NULL ? *body_ : *default_instance_->body_;
+#endif
+}
+inline ::protobuf_sgx_report_body_t* protobuf_sgx_report_t::mutable_body() {
+  set_has_body();
+  if (body_ == NULL) body_ = new ::protobuf_sgx_report_body_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_report_t.body)
+  return body_;
+}
+inline ::protobuf_sgx_report_body_t* protobuf_sgx_report_t::release_body() {
+  clear_has_body();
+  ::protobuf_sgx_report_body_t* temp = body_;
+  body_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_report_t::set_allocated_body(::protobuf_sgx_report_body_t* body) {
+  delete body_;
+  body_ = body;
+  if (body) {
+    set_has_body();
+  } else {
+    clear_has_body();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_report_t.body)
+}
+
+// repeated uint32 key_id = 2 [packed = true];
+inline int protobuf_sgx_report_t::key_id_size() const {
+  return key_id_.size();
+}
+inline void protobuf_sgx_report_t::clear_key_id() {
+  key_id_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_t::key_id(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.key_id)
+  return key_id_.Get(index);
+}
+inline void protobuf_sgx_report_t::set_key_id(int index, ::google::protobuf::uint32 value) {
+  key_id_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_t.key_id)
+}
+inline void protobuf_sgx_report_t::add_key_id(::google::protobuf::uint32 value) {
+  key_id_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_t.key_id)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_t::key_id() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_t.key_id)
+  return key_id_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_t::mutable_key_id() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_t.key_id)
+  return &key_id_;
+}
+
+// repeated uint32 mac = 3 [packed = true];
+inline int protobuf_sgx_report_t::mac_size() const {
+  return mac_.size();
+}
+inline void protobuf_sgx_report_t::clear_mac() {
+  mac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_report_t::mac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_report_t.mac)
+  return mac_.Get(index);
+}
+inline void protobuf_sgx_report_t::set_mac(int index, ::google::protobuf::uint32 value) {
+  mac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_report_t.mac)
+}
+inline void protobuf_sgx_report_t::add_mac(::google::protobuf::uint32 value) {
+  mac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_report_t.mac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_report_t::mac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_report_t.mac)
+  return mac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_report_t::mutable_mac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_report_t.mac)
+  return &mac_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_target_info_t
+
+// repeated uint32 mr_enclave = 1 [packed = true];
+inline int protobuf_sgx_target_info_t::mr_enclave_size() const {
+  return mr_enclave_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_mr_enclave() {
+  mr_enclave_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::mr_enclave(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.mr_enclave)
+  return mr_enclave_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_mr_enclave(int index, ::google::protobuf::uint32 value) {
+  mr_enclave_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.mr_enclave)
+}
+inline void protobuf_sgx_target_info_t::add_mr_enclave(::google::protobuf::uint32 value) {
+  mr_enclave_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.mr_enclave)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::mr_enclave() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.mr_enclave)
+  return mr_enclave_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_mr_enclave() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.mr_enclave)
+  return &mr_enclave_;
+}
+
+// required .protobuf_sgx_attributes_t attributes = 4;
+inline bool protobuf_sgx_target_info_t::has_attributes() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_target_info_t::set_has_attributes() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_target_info_t::clear_has_attributes() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_target_info_t::clear_attributes() {
+  if (attributes_ != NULL) attributes_->::protobuf_sgx_attributes_t::Clear();
+  clear_has_attributes();
+}
+inline const ::protobuf_sgx_attributes_t& protobuf_sgx_target_info_t::attributes() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.attributes)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return attributes_ != NULL ? *attributes_ : *default_instance().attributes_;
+#else
+  return attributes_ != NULL ? *attributes_ : *default_instance_->attributes_;
+#endif
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_target_info_t::mutable_attributes() {
+  set_has_attributes();
+  if (attributes_ == NULL) attributes_ = new ::protobuf_sgx_attributes_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_target_info_t.attributes)
+  return attributes_;
+}
+inline ::protobuf_sgx_attributes_t* protobuf_sgx_target_info_t::release_attributes() {
+  clear_has_attributes();
+  ::protobuf_sgx_attributes_t* temp = attributes_;
+  attributes_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_target_info_t::set_allocated_attributes(::protobuf_sgx_attributes_t* attributes) {
+  delete attributes_;
+  attributes_ = attributes;
+  if (attributes) {
+    set_has_attributes();
+  } else {
+    clear_has_attributes();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_target_info_t.attributes)
+}
+
+// repeated uint32 reserved1 = 2 [packed = true];
+inline int protobuf_sgx_target_info_t::reserved1_size() const {
+  return reserved1_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_reserved1() {
+  reserved1_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::reserved1(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.reserved1)
+  return reserved1_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_reserved1(int index, ::google::protobuf::uint32 value) {
+  reserved1_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.reserved1)
+}
+inline void protobuf_sgx_target_info_t::add_reserved1(::google::protobuf::uint32 value) {
+  reserved1_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.reserved1)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::reserved1() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.reserved1)
+  return reserved1_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_reserved1() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.reserved1)
+  return &reserved1_;
+}
+
+// required uint32 misc_select = 5;
+inline bool protobuf_sgx_target_info_t::has_misc_select() const {
+  return (_has_bits_[0] & 0x00000008u) != 0;
+}
+inline void protobuf_sgx_target_info_t::set_has_misc_select() {
+  _has_bits_[0] |= 0x00000008u;
+}
+inline void protobuf_sgx_target_info_t::clear_has_misc_select() {
+  _has_bits_[0] &= ~0x00000008u;
+}
+inline void protobuf_sgx_target_info_t::clear_misc_select() {
+  misc_select_ = 0u;
+  clear_has_misc_select();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::misc_select() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.misc_select)
+  return misc_select_;
+}
+inline void protobuf_sgx_target_info_t::set_misc_select(::google::protobuf::uint32 value) {
+  set_has_misc_select();
+  misc_select_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.misc_select)
+}
+
+// repeated uint32 reserved2 = 3 [packed = true];
+inline int protobuf_sgx_target_info_t::reserved2_size() const {
+  return reserved2_.size();
+}
+inline void protobuf_sgx_target_info_t::clear_reserved2() {
+  reserved2_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_target_info_t::reserved2(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_target_info_t.reserved2)
+  return reserved2_.Get(index);
+}
+inline void protobuf_sgx_target_info_t::set_reserved2(int index, ::google::protobuf::uint32 value) {
+  reserved2_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_target_info_t.reserved2)
+}
+inline void protobuf_sgx_target_info_t::add_reserved2(::google::protobuf::uint32 value) {
+  reserved2_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_target_info_t.reserved2)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_target_info_t::reserved2() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_target_info_t.reserved2)
+  return reserved2_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_target_info_t::mutable_reserved2() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_target_info_t.reserved2)
+  return &reserved2_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg1_t
+
+// required .protobuf_sgx_ec256_public_t g_a = 1;
+inline bool protobuf_sgx_dh_msg1_t::has_g_a() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg1_t::set_has_g_a() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_has_g_a() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_g_a() {
+  if (g_a_ != NULL) g_a_->::protobuf_sgx_ec256_public_t::Clear();
+  clear_has_g_a();
+}
+inline const ::protobuf_sgx_ec256_public_t& protobuf_sgx_dh_msg1_t::g_a() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg1_t.g_a)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return g_a_ != NULL ? *g_a_ : *default_instance().g_a_;
+#else
+  return g_a_ != NULL ? *g_a_ : *default_instance_->g_a_;
+#endif
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg1_t::mutable_g_a() {
+  set_has_g_a();
+  if (g_a_ == NULL) g_a_ = new ::protobuf_sgx_ec256_public_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg1_t.g_a)
+  return g_a_;
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg1_t::release_g_a() {
+  clear_has_g_a();
+  ::protobuf_sgx_ec256_public_t* temp = g_a_;
+  g_a_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg1_t::set_allocated_g_a(::protobuf_sgx_ec256_public_t* g_a) {
+  delete g_a_;
+  g_a_ = g_a;
+  if (g_a) {
+    set_has_g_a();
+  } else {
+    clear_has_g_a();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg1_t.g_a)
+}
+
+// required .protobuf_sgx_target_info_t target = 2;
+inline bool protobuf_sgx_dh_msg1_t::has_target() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_dh_msg1_t::set_has_target() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_has_target() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_dh_msg1_t::clear_target() {
+  if (target_ != NULL) target_->::protobuf_sgx_target_info_t::Clear();
+  clear_has_target();
+}
+inline const ::protobuf_sgx_target_info_t& protobuf_sgx_dh_msg1_t::target() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg1_t.target)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return target_ != NULL ? *target_ : *default_instance().target_;
+#else
+  return target_ != NULL ? *target_ : *default_instance_->target_;
+#endif
+}
+inline ::protobuf_sgx_target_info_t* protobuf_sgx_dh_msg1_t::mutable_target() {
+  set_has_target();
+  if (target_ == NULL) target_ = new ::protobuf_sgx_target_info_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg1_t.target)
+  return target_;
+}
+inline ::protobuf_sgx_target_info_t* protobuf_sgx_dh_msg1_t::release_target() {
+  clear_has_target();
+  ::protobuf_sgx_target_info_t* temp = target_;
+  target_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg1_t::set_allocated_target(::protobuf_sgx_target_info_t* target) {
+  delete target_;
+  target_ = target;
+  if (target) {
+    set_has_target();
+  } else {
+    clear_has_target();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg1_t.target)
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg2_t
+
+// required .protobuf_sgx_ec256_public_t g_b = 1;
+inline bool protobuf_sgx_dh_msg2_t::has_g_b() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg2_t::set_has_g_b() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_has_g_b() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_g_b() {
+  if (g_b_ != NULL) g_b_->::protobuf_sgx_ec256_public_t::Clear();
+  clear_has_g_b();
+}
+inline const ::protobuf_sgx_ec256_public_t& protobuf_sgx_dh_msg2_t::g_b() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.g_b)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return g_b_ != NULL ? *g_b_ : *default_instance().g_b_;
+#else
+  return g_b_ != NULL ? *g_b_ : *default_instance_->g_b_;
+#endif
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg2_t::mutable_g_b() {
+  set_has_g_b();
+  if (g_b_ == NULL) g_b_ = new ::protobuf_sgx_ec256_public_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg2_t.g_b)
+  return g_b_;
+}
+inline ::protobuf_sgx_ec256_public_t* protobuf_sgx_dh_msg2_t::release_g_b() {
+  clear_has_g_b();
+  ::protobuf_sgx_ec256_public_t* temp = g_b_;
+  g_b_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg2_t::set_allocated_g_b(::protobuf_sgx_ec256_public_t* g_b) {
+  delete g_b_;
+  g_b_ = g_b;
+  if (g_b) {
+    set_has_g_b();
+  } else {
+    clear_has_g_b();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg2_t.g_b)
+}
+
+// required .protobuf_sgx_report_t report = 2;
+inline bool protobuf_sgx_dh_msg2_t::has_report() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_dh_msg2_t::set_has_report() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_has_report() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_dh_msg2_t::clear_report() {
+  if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+  clear_has_report();
+}
+inline const ::protobuf_sgx_report_t& protobuf_sgx_dh_msg2_t::report() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.report)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return report_ != NULL ? *report_ : *default_instance().report_;
+#else
+  return report_ != NULL ? *report_ : *default_instance_->report_;
+#endif
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg2_t::mutable_report() {
+  set_has_report();
+  if (report_ == NULL) report_ = new ::protobuf_sgx_report_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg2_t.report)
+  return report_;
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg2_t::release_report() {
+  clear_has_report();
+  ::protobuf_sgx_report_t* temp = report_;
+  report_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg2_t::set_allocated_report(::protobuf_sgx_report_t* report) {
+  delete report_;
+  report_ = report;
+  if (report) {
+    set_has_report();
+  } else {
+    clear_has_report();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg2_t.report)
+}
+
+// repeated uint32 cmac = 3 [packed = true];
+inline int protobuf_sgx_dh_msg2_t::cmac_size() const {
+  return cmac_.size();
+}
+inline void protobuf_sgx_dh_msg2_t::clear_cmac() {
+  cmac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg2_t::cmac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg2_t.cmac)
+  return cmac_.Get(index);
+}
+inline void protobuf_sgx_dh_msg2_t::set_cmac(int index, ::google::protobuf::uint32 value) {
+  cmac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg2_t.cmac)
+}
+inline void protobuf_sgx_dh_msg2_t::add_cmac(::google::protobuf::uint32 value) {
+  cmac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg2_t.cmac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg2_t::cmac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg2_t.cmac)
+  return cmac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg2_t::mutable_cmac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg2_t.cmac)
+  return &cmac_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg3_body_t
+
+// required .protobuf_sgx_report_t report = 1;
+inline bool protobuf_sgx_dh_msg3_body_t::has_report() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_has_report() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_has_report() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_report() {
+  if (report_ != NULL) report_->::protobuf_sgx_report_t::Clear();
+  clear_has_report();
+}
+inline const ::protobuf_sgx_report_t& protobuf_sgx_dh_msg3_body_t::report() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_body_t.report)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return report_ != NULL ? *report_ : *default_instance().report_;
+#else
+  return report_ != NULL ? *report_ : *default_instance_->report_;
+#endif
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg3_body_t::mutable_report() {
+  set_has_report();
+  if (report_ == NULL) report_ = new ::protobuf_sgx_report_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg3_body_t.report)
+  return report_;
+}
+inline ::protobuf_sgx_report_t* protobuf_sgx_dh_msg3_body_t::release_report() {
+  clear_has_report();
+  ::protobuf_sgx_report_t* temp = report_;
+  report_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_allocated_report(::protobuf_sgx_report_t* report) {
+  delete report_;
+  report_ = report;
+  if (report) {
+    set_has_report();
+  } else {
+    clear_has_report();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg3_body_t.report)
+}
+
+// repeated uint32 additional_prop = 2;
+inline int protobuf_sgx_dh_msg3_body_t::additional_prop_size() const {
+  return additional_prop_.size();
+}
+inline void protobuf_sgx_dh_msg3_body_t::clear_additional_prop() {
+  additional_prop_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg3_body_t::additional_prop(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return additional_prop_.Get(index);
+}
+inline void protobuf_sgx_dh_msg3_body_t::set_additional_prop(int index, ::google::protobuf::uint32 value) {
+  additional_prop_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg3_body_t.additional_prop)
+}
+inline void protobuf_sgx_dh_msg3_body_t::add_additional_prop(::google::protobuf::uint32 value) {
+  additional_prop_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg3_body_t.additional_prop)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg3_body_t::additional_prop() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return additional_prop_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg3_body_t::mutable_additional_prop() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg3_body_t.additional_prop)
+  return &additional_prop_;
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_sgx_dh_msg3_t
+
+// required .protobuf_sgx_dh_msg3_body_t msg3_body = 1;
+inline bool protobuf_sgx_dh_msg3_t::has_msg3_body() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_dh_msg3_t::set_has_msg3_body() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_t::clear_has_msg3_body() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_dh_msg3_t::clear_msg3_body() {
+  if (msg3_body_ != NULL) msg3_body_->::protobuf_sgx_dh_msg3_body_t::Clear();
+  clear_has_msg3_body();
+}
+inline const ::protobuf_sgx_dh_msg3_body_t& protobuf_sgx_dh_msg3_t::msg3_body() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_t.msg3_body)
+#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
+  return msg3_body_ != NULL ? *msg3_body_ : *default_instance().msg3_body_;
+#else
+  return msg3_body_ != NULL ? *msg3_body_ : *default_instance_->msg3_body_;
+#endif
+}
+inline ::protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_t::mutable_msg3_body() {
+  set_has_msg3_body();
+  if (msg3_body_ == NULL) msg3_body_ = new ::protobuf_sgx_dh_msg3_body_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_dh_msg3_t.msg3_body)
+  return msg3_body_;
+}
+inline ::protobuf_sgx_dh_msg3_body_t* protobuf_sgx_dh_msg3_t::release_msg3_body() {
+  clear_has_msg3_body();
+  ::protobuf_sgx_dh_msg3_body_t* temp = msg3_body_;
+  msg3_body_ = NULL;
+  return temp;
+}
+inline void protobuf_sgx_dh_msg3_t::set_allocated_msg3_body(::protobuf_sgx_dh_msg3_body_t* msg3_body) {
+  delete msg3_body_;
+  msg3_body_ = msg3_body;
+  if (msg3_body) {
+    set_has_msg3_body();
+  } else {
+    clear_has_msg3_body();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_dh_msg3_t.msg3_body)
+}
+
+// repeated uint32 cmac = 2 [packed = true];
+inline int protobuf_sgx_dh_msg3_t::cmac_size() const {
+  return cmac_.size();
+}
+inline void protobuf_sgx_dh_msg3_t::clear_cmac() {
+  cmac_.Clear();
+}
+inline ::google::protobuf::uint32 protobuf_sgx_dh_msg3_t::cmac(int index) const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_dh_msg3_t.cmac)
+  return cmac_.Get(index);
+}
+inline void protobuf_sgx_dh_msg3_t::set_cmac(int index, ::google::protobuf::uint32 value) {
+  cmac_.Set(index, value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_dh_msg3_t.cmac)
+}
+inline void protobuf_sgx_dh_msg3_t::add_cmac(::google::protobuf::uint32 value) {
+  cmac_.Add(value);
+  // @@protoc_insertion_point(field_add:protobuf_sgx_dh_msg3_t.cmac)
+}
+inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
+protobuf_sgx_dh_msg3_t::cmac() const {
+  // @@protoc_insertion_point(field_list:protobuf_sgx_dh_msg3_t.cmac)
+  return cmac_;
+}
+inline ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
+protobuf_sgx_dh_msg3_t::mutable_cmac() {
+  // @@protoc_insertion_point(field_mutable_list:protobuf_sgx_dh_msg3_t.cmac)
+  return &cmac_;
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_ProtobufLAMessages_2eproto__INCLUDED

+ 560 - 0
include/ProtobufSealerMessages.pb.h

@@ -0,0 +1,560 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: ProtobufSealerMessages.proto
+
+#ifndef PROTOBUF_ProtobufSealerMessages_2eproto__INCLUDED
+#define PROTOBUF_ProtobufSealerMessages_2eproto__INCLUDED
+
+#include <string>
+
+#include <google/protobuf/stubs/common.h>
+
+#if GOOGLE_PROTOBUF_VERSION < 2006000
+#error This file was generated by a newer version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please update
+#error your headers.
+#endif
+#if 2006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
+#error This file was generated by an older version of protoc which is
+#error incompatible with your Protocol Buffer headers.  Please
+#error regenerate this file with a newer version of protoc.
+#endif
+
+#include <google/protobuf/generated_message_util.h>
+#include <google/protobuf/message.h>
+#include <google/protobuf/repeated_field.h>
+#include <google/protobuf/extension_set.h>
+#include <google/protobuf/unknown_field_set.h>
+// @@protoc_insertion_point(includes)
+
+// Internal implementation detail -- do not call these.
+void  protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+void protobuf_AssignDesc_ProtobufSealerMessages_2eproto();
+void protobuf_ShutdownFile_ProtobufSealerMessages_2eproto();
+
+class protobuf_sgx_mc_uuid_t;
+class protobuf_plaintext_seal_message;
+
+// ===================================================================
+
+class protobuf_sgx_mc_uuid_t : public ::google::protobuf::Message {
+ public:
+  protobuf_sgx_mc_uuid_t();
+  virtual ~protobuf_sgx_mc_uuid_t();
+
+  protobuf_sgx_mc_uuid_t(const protobuf_sgx_mc_uuid_t& from);
+
+  inline protobuf_sgx_mc_uuid_t& operator=(const protobuf_sgx_mc_uuid_t& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const protobuf_sgx_mc_uuid_t& default_instance();
+
+  void Swap(protobuf_sgx_mc_uuid_t* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_sgx_mc_uuid_t* New() const;
+  void CopyFrom(const ::google::protobuf::Message& from);
+  void MergeFrom(const ::google::protobuf::Message& from);
+  void CopyFrom(const protobuf_sgx_mc_uuid_t& from);
+  void MergeFrom(const protobuf_sgx_mc_uuid_t& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::google::protobuf::Metadata GetMetadata() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required bytes nonce = 1;
+  inline bool has_nonce() const;
+  inline void clear_nonce();
+  static const int kNonceFieldNumber = 1;
+  inline const ::std::string& nonce() const;
+  inline void set_nonce(const ::std::string& value);
+  inline void set_nonce(const char* value);
+  inline void set_nonce(const void* value, size_t size);
+  inline ::std::string* mutable_nonce();
+  inline ::std::string* release_nonce();
+  inline void set_allocated_nonce(::std::string* nonce);
+
+  // required bytes counter_id = 2;
+  inline bool has_counter_id() const;
+  inline void clear_counter_id();
+  static const int kCounterIdFieldNumber = 2;
+  inline const ::std::string& counter_id() const;
+  inline void set_counter_id(const ::std::string& value);
+  inline void set_counter_id(const char* value);
+  inline void set_counter_id(const void* value, size_t size);
+  inline ::std::string* mutable_counter_id();
+  inline ::std::string* release_counter_id();
+  inline void set_allocated_counter_id(::std::string* counter_id);
+
+  // @@protoc_insertion_point(class_scope:protobuf_sgx_mc_uuid_t)
+ private:
+  inline void set_has_nonce();
+  inline void clear_has_nonce();
+  inline void set_has_counter_id();
+  inline void clear_has_counter_id();
+
+  ::google::protobuf::UnknownFieldSet _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::std::string* nonce_;
+  ::std::string* counter_id_;
+  friend void  protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  friend void protobuf_AssignDesc_ProtobufSealerMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufSealerMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_sgx_mc_uuid_t* default_instance_;
+};
+// -------------------------------------------------------------------
+
+class protobuf_plaintext_seal_message : public ::google::protobuf::Message {
+ public:
+  protobuf_plaintext_seal_message();
+  virtual ~protobuf_plaintext_seal_message();
+
+  protobuf_plaintext_seal_message(const protobuf_plaintext_seal_message& from);
+
+  inline protobuf_plaintext_seal_message& operator=(const protobuf_plaintext_seal_message& from) {
+    CopyFrom(from);
+    return *this;
+  }
+
+  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
+    return _unknown_fields_;
+  }
+
+  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
+    return &_unknown_fields_;
+  }
+
+  static const ::google::protobuf::Descriptor* descriptor();
+  static const protobuf_plaintext_seal_message& default_instance();
+
+  void Swap(protobuf_plaintext_seal_message* other);
+
+  // implements Message ----------------------------------------------
+
+  protobuf_plaintext_seal_message* New() const;
+  void CopyFrom(const ::google::protobuf::Message& from);
+  void MergeFrom(const ::google::protobuf::Message& from);
+  void CopyFrom(const protobuf_plaintext_seal_message& from);
+  void MergeFrom(const protobuf_plaintext_seal_message& from);
+  void Clear();
+  bool IsInitialized() const;
+
+  int ByteSize() const;
+  bool MergePartialFromCodedStream(
+      ::google::protobuf::io::CodedInputStream* input);
+  void SerializeWithCachedSizes(
+      ::google::protobuf::io::CodedOutputStream* output) const;
+  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
+  int GetCachedSize() const { return _cached_size_; }
+  private:
+  void SharedCtor();
+  void SharedDtor();
+  void SetCachedSize(int size) const;
+  public:
+  ::google::protobuf::Metadata GetMetadata() const;
+
+  // nested types ----------------------------------------------------
+
+  // accessors -------------------------------------------------------
+
+  // required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+  inline bool has_monotonic_counter_id() const;
+  inline void clear_monotonic_counter_id();
+  static const int kMonotonicCounterIdFieldNumber = 1;
+  inline const ::protobuf_sgx_mc_uuid_t& monotonic_counter_id() const;
+  inline ::protobuf_sgx_mc_uuid_t* mutable_monotonic_counter_id();
+  inline ::protobuf_sgx_mc_uuid_t* release_monotonic_counter_id();
+  inline void set_allocated_monotonic_counter_id(::protobuf_sgx_mc_uuid_t* monotonic_counter_id);
+
+  // required uint32 monotonic_counter_value = 2;
+  inline bool has_monotonic_counter_value() const;
+  inline void clear_monotonic_counter_value();
+  static const int kMonotonicCounterValueFieldNumber = 2;
+  inline ::google::protobuf::uint32 monotonic_counter_value() const;
+  inline void set_monotonic_counter_value(::google::protobuf::uint32 value);
+
+  // required bytes message = 3;
+  inline bool has_message() const;
+  inline void clear_message();
+  static const int kMessageFieldNumber = 3;
+  inline const ::std::string& message() const;
+  inline void set_message(const ::std::string& value);
+  inline void set_message(const char* value);
+  inline void set_message(const void* value, size_t size);
+  inline ::std::string* mutable_message();
+  inline ::std::string* release_message();
+  inline void set_allocated_message(::std::string* message);
+
+  // @@protoc_insertion_point(class_scope:protobuf_plaintext_seal_message)
+ private:
+  inline void set_has_monotonic_counter_id();
+  inline void clear_has_monotonic_counter_id();
+  inline void set_has_monotonic_counter_value();
+  inline void clear_has_monotonic_counter_value();
+  inline void set_has_message();
+  inline void clear_has_message();
+
+  ::google::protobuf::UnknownFieldSet _unknown_fields_;
+
+  ::google::protobuf::uint32 _has_bits_[1];
+  mutable int _cached_size_;
+  ::protobuf_sgx_mc_uuid_t* monotonic_counter_id_;
+  ::std::string* message_;
+  ::google::protobuf::uint32 monotonic_counter_value_;
+  friend void  protobuf_AddDesc_ProtobufSealerMessages_2eproto();
+  friend void protobuf_AssignDesc_ProtobufSealerMessages_2eproto();
+  friend void protobuf_ShutdownFile_ProtobufSealerMessages_2eproto();
+
+  void InitAsDefaultInstance();
+  static protobuf_plaintext_seal_message* default_instance_;
+};
+// ===================================================================
+
+
+// ===================================================================
+
+// protobuf_sgx_mc_uuid_t
+
+// required bytes nonce = 1;
+inline bool protobuf_sgx_mc_uuid_t::has_nonce() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_sgx_mc_uuid_t::set_has_nonce() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_sgx_mc_uuid_t::clear_has_nonce() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_sgx_mc_uuid_t::clear_nonce() {
+  if (nonce_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    nonce_->clear();
+  }
+  clear_has_nonce();
+}
+inline const ::std::string& protobuf_sgx_mc_uuid_t::nonce() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_mc_uuid_t.nonce)
+  return *nonce_;
+}
+inline void protobuf_sgx_mc_uuid_t::set_nonce(const ::std::string& value) {
+  set_has_nonce();
+  if (nonce_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    nonce_ = new ::std::string;
+  }
+  nonce_->assign(value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_mc_uuid_t.nonce)
+}
+inline void protobuf_sgx_mc_uuid_t::set_nonce(const char* value) {
+  set_has_nonce();
+  if (nonce_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    nonce_ = new ::std::string;
+  }
+  nonce_->assign(value);
+  // @@protoc_insertion_point(field_set_char:protobuf_sgx_mc_uuid_t.nonce)
+}
+inline void protobuf_sgx_mc_uuid_t::set_nonce(const void* value, size_t size) {
+  set_has_nonce();
+  if (nonce_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    nonce_ = new ::std::string;
+  }
+  nonce_->assign(reinterpret_cast<const char*>(value), size);
+  // @@protoc_insertion_point(field_set_pointer:protobuf_sgx_mc_uuid_t.nonce)
+}
+inline ::std::string* protobuf_sgx_mc_uuid_t::mutable_nonce() {
+  set_has_nonce();
+  if (nonce_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    nonce_ = new ::std::string;
+  }
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_mc_uuid_t.nonce)
+  return nonce_;
+}
+inline ::std::string* protobuf_sgx_mc_uuid_t::release_nonce() {
+  clear_has_nonce();
+  if (nonce_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    return NULL;
+  } else {
+    ::std::string* temp = nonce_;
+    nonce_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    return temp;
+  }
+}
+inline void protobuf_sgx_mc_uuid_t::set_allocated_nonce(::std::string* nonce) {
+  if (nonce_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete nonce_;
+  }
+  if (nonce) {
+    set_has_nonce();
+    nonce_ = nonce;
+  } else {
+    clear_has_nonce();
+    nonce_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_mc_uuid_t.nonce)
+}
+
+// required bytes counter_id = 2;
+inline bool protobuf_sgx_mc_uuid_t::has_counter_id() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_sgx_mc_uuid_t::set_has_counter_id() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_sgx_mc_uuid_t::clear_has_counter_id() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_sgx_mc_uuid_t::clear_counter_id() {
+  if (counter_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    counter_id_->clear();
+  }
+  clear_has_counter_id();
+}
+inline const ::std::string& protobuf_sgx_mc_uuid_t::counter_id() const {
+  // @@protoc_insertion_point(field_get:protobuf_sgx_mc_uuid_t.counter_id)
+  return *counter_id_;
+}
+inline void protobuf_sgx_mc_uuid_t::set_counter_id(const ::std::string& value) {
+  set_has_counter_id();
+  if (counter_id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    counter_id_ = new ::std::string;
+  }
+  counter_id_->assign(value);
+  // @@protoc_insertion_point(field_set:protobuf_sgx_mc_uuid_t.counter_id)
+}
+inline void protobuf_sgx_mc_uuid_t::set_counter_id(const char* value) {
+  set_has_counter_id();
+  if (counter_id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    counter_id_ = new ::std::string;
+  }
+  counter_id_->assign(value);
+  // @@protoc_insertion_point(field_set_char:protobuf_sgx_mc_uuid_t.counter_id)
+}
+inline void protobuf_sgx_mc_uuid_t::set_counter_id(const void* value, size_t size) {
+  set_has_counter_id();
+  if (counter_id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    counter_id_ = new ::std::string;
+  }
+  counter_id_->assign(reinterpret_cast<const char*>(value), size);
+  // @@protoc_insertion_point(field_set_pointer:protobuf_sgx_mc_uuid_t.counter_id)
+}
+inline ::std::string* protobuf_sgx_mc_uuid_t::mutable_counter_id() {
+  set_has_counter_id();
+  if (counter_id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    counter_id_ = new ::std::string;
+  }
+  // @@protoc_insertion_point(field_mutable:protobuf_sgx_mc_uuid_t.counter_id)
+  return counter_id_;
+}
+inline ::std::string* protobuf_sgx_mc_uuid_t::release_counter_id() {
+  clear_has_counter_id();
+  if (counter_id_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    return NULL;
+  } else {
+    ::std::string* temp = counter_id_;
+    counter_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    return temp;
+  }
+}
+inline void protobuf_sgx_mc_uuid_t::set_allocated_counter_id(::std::string* counter_id) {
+  if (counter_id_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete counter_id_;
+  }
+  if (counter_id) {
+    set_has_counter_id();
+    counter_id_ = counter_id;
+  } else {
+    clear_has_counter_id();
+    counter_id_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_sgx_mc_uuid_t.counter_id)
+}
+
+// -------------------------------------------------------------------
+
+// protobuf_plaintext_seal_message
+
+// required .protobuf_sgx_mc_uuid_t monotonic_counter_id = 1;
+inline bool protobuf_plaintext_seal_message::has_monotonic_counter_id() const {
+  return (_has_bits_[0] & 0x00000001u) != 0;
+}
+inline void protobuf_plaintext_seal_message::set_has_monotonic_counter_id() {
+  _has_bits_[0] |= 0x00000001u;
+}
+inline void protobuf_plaintext_seal_message::clear_has_monotonic_counter_id() {
+  _has_bits_[0] &= ~0x00000001u;
+}
+inline void protobuf_plaintext_seal_message::clear_monotonic_counter_id() {
+  if (monotonic_counter_id_ != NULL) monotonic_counter_id_->::protobuf_sgx_mc_uuid_t::Clear();
+  clear_has_monotonic_counter_id();
+}
+inline const ::protobuf_sgx_mc_uuid_t& protobuf_plaintext_seal_message::monotonic_counter_id() const {
+  // @@protoc_insertion_point(field_get:protobuf_plaintext_seal_message.monotonic_counter_id)
+  return monotonic_counter_id_ != NULL ? *monotonic_counter_id_ : *default_instance_->monotonic_counter_id_;
+}
+inline ::protobuf_sgx_mc_uuid_t* protobuf_plaintext_seal_message::mutable_monotonic_counter_id() {
+  set_has_monotonic_counter_id();
+  if (monotonic_counter_id_ == NULL) monotonic_counter_id_ = new ::protobuf_sgx_mc_uuid_t;
+  // @@protoc_insertion_point(field_mutable:protobuf_plaintext_seal_message.monotonic_counter_id)
+  return monotonic_counter_id_;
+}
+inline ::protobuf_sgx_mc_uuid_t* protobuf_plaintext_seal_message::release_monotonic_counter_id() {
+  clear_has_monotonic_counter_id();
+  ::protobuf_sgx_mc_uuid_t* temp = monotonic_counter_id_;
+  monotonic_counter_id_ = NULL;
+  return temp;
+}
+inline void protobuf_plaintext_seal_message::set_allocated_monotonic_counter_id(::protobuf_sgx_mc_uuid_t* monotonic_counter_id) {
+  delete monotonic_counter_id_;
+  monotonic_counter_id_ = monotonic_counter_id;
+  if (monotonic_counter_id) {
+    set_has_monotonic_counter_id();
+  } else {
+    clear_has_monotonic_counter_id();
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_plaintext_seal_message.monotonic_counter_id)
+}
+
+// required uint32 monotonic_counter_value = 2;
+inline bool protobuf_plaintext_seal_message::has_monotonic_counter_value() const {
+  return (_has_bits_[0] & 0x00000002u) != 0;
+}
+inline void protobuf_plaintext_seal_message::set_has_monotonic_counter_value() {
+  _has_bits_[0] |= 0x00000002u;
+}
+inline void protobuf_plaintext_seal_message::clear_has_monotonic_counter_value() {
+  _has_bits_[0] &= ~0x00000002u;
+}
+inline void protobuf_plaintext_seal_message::clear_monotonic_counter_value() {
+  monotonic_counter_value_ = 0u;
+  clear_has_monotonic_counter_value();
+}
+inline ::google::protobuf::uint32 protobuf_plaintext_seal_message::monotonic_counter_value() const {
+  // @@protoc_insertion_point(field_get:protobuf_plaintext_seal_message.monotonic_counter_value)
+  return monotonic_counter_value_;
+}
+inline void protobuf_plaintext_seal_message::set_monotonic_counter_value(::google::protobuf::uint32 value) {
+  set_has_monotonic_counter_value();
+  monotonic_counter_value_ = value;
+  // @@protoc_insertion_point(field_set:protobuf_plaintext_seal_message.monotonic_counter_value)
+}
+
+// required bytes message = 3;
+inline bool protobuf_plaintext_seal_message::has_message() const {
+  return (_has_bits_[0] & 0x00000004u) != 0;
+}
+inline void protobuf_plaintext_seal_message::set_has_message() {
+  _has_bits_[0] |= 0x00000004u;
+}
+inline void protobuf_plaintext_seal_message::clear_has_message() {
+  _has_bits_[0] &= ~0x00000004u;
+}
+inline void protobuf_plaintext_seal_message::clear_message() {
+  if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    message_->clear();
+  }
+  clear_has_message();
+}
+inline const ::std::string& protobuf_plaintext_seal_message::message() const {
+  // @@protoc_insertion_point(field_get:protobuf_plaintext_seal_message.message)
+  return *message_;
+}
+inline void protobuf_plaintext_seal_message::set_message(const ::std::string& value) {
+  set_has_message();
+  if (message_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    message_ = new ::std::string;
+  }
+  message_->assign(value);
+  // @@protoc_insertion_point(field_set:protobuf_plaintext_seal_message.message)
+}
+inline void protobuf_plaintext_seal_message::set_message(const char* value) {
+  set_has_message();
+  if (message_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    message_ = new ::std::string;
+  }
+  message_->assign(value);
+  // @@protoc_insertion_point(field_set_char:protobuf_plaintext_seal_message.message)
+}
+inline void protobuf_plaintext_seal_message::set_message(const void* value, size_t size) {
+  set_has_message();
+  if (message_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    message_ = new ::std::string;
+  }
+  message_->assign(reinterpret_cast<const char*>(value), size);
+  // @@protoc_insertion_point(field_set_pointer:protobuf_plaintext_seal_message.message)
+}
+inline ::std::string* protobuf_plaintext_seal_message::mutable_message() {
+  set_has_message();
+  if (message_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    message_ = new ::std::string;
+  }
+  // @@protoc_insertion_point(field_mutable:protobuf_plaintext_seal_message.message)
+  return message_;
+}
+inline ::std::string* protobuf_plaintext_seal_message::release_message() {
+  clear_has_message();
+  if (message_ == &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    return NULL;
+  } else {
+    ::std::string* temp = message_;
+    message_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+    return temp;
+  }
+}
+inline void protobuf_plaintext_seal_message::set_allocated_message(::std::string* message) {
+  if (message_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
+    delete message_;
+  }
+  if (message) {
+    set_has_message();
+    message_ = message;
+  } else {
+    clear_has_message();
+    message_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
+  }
+  // @@protoc_insertion_point(field_set_allocated:protobuf_plaintext_seal_message.message)
+}
+
+
+// @@protoc_insertion_point(namespace_scope)
+
+#ifndef SWIG
+namespace google {
+namespace protobuf {
+
+
+}  // namespace google
+}  // namespace protobuf
+#endif  // SWIG
+
+// @@protoc_insertion_point(global_scope)
+
+#endif  // PROTOBUF_ProtobufSealerMessages_2eproto__INCLUDED

+ 2 - 0
include/ProtobufSgxLATransforms_Inititator.h

@@ -0,0 +1,2 @@
+int exchange_report_call(int fd, sgx_dh_msg2_t *dh_msg2, sgx_dh_msg3_t *dh_msg3);
+int session_request_call(int fd, sgx_dh_msg1_t *dh_msg1); 

+ 11 - 0
include/ProtobufSgxSealerTransforms.h

@@ -0,0 +1,11 @@
+#pragma once
+#include <string>
+#include <sgx_tae_service.h> // For sgx_mc_uuid_t structure. // TODO: Uncomment this. 
+
+namespace ProtobufSgxTransforms {
+  uint32_t encode_message_and_counter_to_protobuf_string(std::string& plaintext, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value, std::string& serialized_plaintext);
+//  void decode_protobuf_message_to_counter_id_and_value(protobuf_plaintext_seal_message& protobuf_unsealed_msg, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value);
+  void decode_protobuf_message_to_counter_id_and_value(std::string& temp_plaintext_str, sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value);
+//  void decode_protobuf_message_to_plaintext(protobuf_plaintext_seal_message& protobuf_unsealed_msg, std::string& plaintext);
+  void decode_protobuf_message_to_plaintext(std::string& temp_plaintext_str , std::string& plaintext);
+}

+ 4 - 0
include/SealerWrapper.h

@@ -0,0 +1,4 @@
+    uint32_t seal_message_to_file(int fd, std::string& plaintext, uint32_t* actual_sealed_msg_size);
+    uint32_t unseal_message_from_file(int fd, std::string& sealed_msg, uint32_t* expected_sealed_msg_size);
+    uint32_t init();
+

+ 1 - 0
include/SgxCrypto.h

@@ -0,0 +1 @@
+int create_rsa_key_pair_for_signing_manifest();

+ 1 - 0
include/SgxLAInititator.h

@@ -0,0 +1 @@
+int create_session(int fd, uint8_t* mr_enclave, uint8_t* mr_signer, uint8_t* send_mr_signer);

+ 10 - 0
include/SgxSealer.h

@@ -0,0 +1,10 @@
+//#include "sgx_tae_service.h" // For sgx_sealed_data_t struct
+//class Sealer {
+//private: 
+//    uint32_t verify_sgx_monotonic_counter_value(sgx_mc_uuid_t* sgx_monotonic_counter_id, uint32_t* sgx_monotonic_counter_value); 
+//    uint32_t create_sgx_monotonic_counter_id_and_value(sgx_mc_uuid_t* sgx_counter_id, uint32_t* sgx_counter_value);
+//public:
+  uint32_t initialize_pse_and_counter();
+  uint32_t seal_message(std::string& plaintext_str, std::string& sgx_sealed_msg);
+  uint32_t unseal_and_verify_sealed_message(std::string& sgx_sealed_msg_str, std::string& plaintext);
+//}

+ 105 - 0
include/datatypes.h

@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "sgx_report.h"
+#include "sgx_eid.h"
+#include "sgx_ecp_types.h"
+#include "sgx_dh.h"
+#include "sgx_tseal.h"
+
+#ifndef DATATYPES_H_
+#define DATATYPES_H_
+
+#define DH_KEY_SIZE        20
+#define NONCE_SIZE         16
+#define MAC_SIZE           16
+#define MAC_KEY_SIZE       16
+#define PADDING_SIZE       16
+
+#define TAG_SIZE        16
+#define IV_SIZE            12
+
+#define DERIVE_MAC_KEY      0x0
+#define DERIVE_SESSION_KEY  0x1
+#define DERIVE_VK1_KEY      0x3
+#define DERIVE_VK2_KEY      0x4
+
+#define CLOSED 0x0
+#define IN_PROGRESS 0x1
+#define ACTIVE 0x2
+
+#define MESSAGE_EXCHANGE 0x0
+#define ENCLAVE_TO_ENCLAVE_CALL 0x1
+
+#define INVALID_ARGUMENT                   -2   ///< Invalid function argument
+#define LOGIC_ERROR                        -3   ///< Functional logic error
+#define FILE_NOT_FOUND                     -4   ///< File not found
+
+#define SAFE_FREE(ptr)     {if (NULL != (ptr)) {free(ptr); (ptr)=NULL;}}
+
+#define VMC_ATTRIBUTE_MASK  0xFFFFFFFFFFFFFFCB
+
+typedef uint8_t dh_nonce[NONCE_SIZE];
+typedef uint8_t cmac_128[MAC_SIZE];
+
+#pragma pack(push, 1)
+
+//Format of the AES-GCM message being exchanged between the source and the destination enclaves
+typedef struct _secure_message_t
+{
+    uint32_t session_id; //Session ID identifyting the session to which the message belongs
+    sgx_aes_gcm_data_t message_aes_gcm_data;    
+}secure_message_t;
+
+//Format of the input function parameter structure
+typedef struct _ms_in_msg_exchange_t {
+    uint32_t msg_type; //Type of Call E2E or general message exchange
+    uint32_t target_fn_id; //Function Id to be called in Destination. Is valid only when msg_type=ENCLAVE_TO_ENCLAVE_CALL
+    uint32_t inparam_buff_len; //Length of the serialized input parameters
+    char inparam_buff[]; //Serialized input parameters
+} ms_in_msg_exchange_t;
+
+//Format of the return value and output function parameter structure
+typedef struct _ms_out_msg_exchange_t {
+    uint32_t retval_len; //Length of the return value
+    uint32_t ret_outparam_buff_len; //Length of the serialized return value and output parameters
+    char ret_outparam_buff[]; //Serialized return value and output parameters
+} ms_out_msg_exchange_t;
+
+//Session Tracker to generate session ids
+typedef struct _session_id_tracker_t
+{
+    uint32_t          session_id;
+}session_id_tracker_t;
+
+#pragma pack(pop)
+
+#endif

+ 68 - 0
include/dh_session_protocol.h

@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _DH_SESSION_PROROCOL_H
+#define _DH_SESSION_PROROCOL_H
+
+#include "sgx_ecp_types.h"
+#include "sgx_key.h"
+#include "sgx_report.h"
+#include "sgx_attributes.h"
+
+#define NONCE_SIZE         16
+#define MAC_SIZE           16
+
+#define MSG_BUF_LEN        sizeof(ec_pub_t)*2
+#define MSG_HASH_SZ        32
+
+
+//Session information structure
+typedef struct _la_dh_session_t
+{
+    uint32_t  session_id; //Identifies the current session
+    uint32_t  status; //Indicates session is in progress, active or closed
+    union
+    {
+        struct
+        {
+			sgx_dh_session_t dh_session;
+        }in_progress;
+
+        struct
+        {
+            sgx_key_128bit_t AEK; //Session Key
+            uint32_t counter; //Used to store Message Sequence Number
+        }active;
+    };
+} dh_session_t;
+
+
+#endif

+ 53 - 0
include/error_codes.h

@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef ERROR_CODES_H_
+#define ERROR_CODES_H_
+
+typedef uint32_t ATTESTATION_STATUS;
+
+#define SUCCESS                          0x00
+#define INVALID_PARAMETER                0xE1
+#define VALID_SESSION                    0xE2
+#define INVALID_SESSION                  0xE3
+#define ATTESTATION_ERROR                0xE4
+#define ATTESTATION_SE_ERROR             0xE5
+#define IPP_ERROR                        0xE6
+#define NO_AVAILABLE_SESSION_ERROR       0xE7
+#define MALLOC_ERROR                     0xE8
+#define ERROR_TAG_MISMATCH               0xE9
+#define OUT_BUFFER_LENGTH_ERROR          0xEA
+#define INVALID_REQUEST_TYPE_ERROR       0xEB
+#define INVALID_PARAMETER_ERROR          0xEC
+#define ENCLAVE_TRUST_ERROR              0xED
+#define ENCRYPT_DECRYPT_ERROR            0xEE
+#define DUPLICATE_SESSION                0xEF
+#endif

+ 1 - 0
include/ipc.h

@@ -0,0 +1 @@
+int set_up_socket_connect(int port); 

BIN
new_sgx_libs/libsgx_tcrypto.a


BIN
new_sgx_libs/libsgx_trts.a


BIN
new_sgx_libs/libsgx_tservice.a


BIN
new_sgx_libs/libsgx_tstdc.a


BIN
new_sgx_libs/libsgx_tstdcxx.a


BIN
old_sgx_libs/libsgx_tcrypto.a


BIN
old_sgx_libs/libsgx_trts.a


BIN
old_sgx_libs/libsgx_tservice.a


BIN
old_sgx_libs/libsgx_tstdc.a


+ 42 - 0
systemIpc.cpp

@@ -0,0 +1,42 @@
+// For socket programming
+#include <arpa/inet.h>
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+
+// Sets up a socket connected to the port passed as input - returns the socket FD on success and -1 on error.
+// Also prints the errno on error.
+int set_up_socket_connect(int port)
+{
+  int sock = 0;
+  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
+  {
+    printf("\n Error in socket call - errno is %d \n", errno);
+    return -1;
+  }
+
+  struct sockaddr_in serv_addr;
+  memset(&serv_addr, '0', sizeof(serv_addr));
+
+  serv_addr.sin_family = AF_INET;
+  serv_addr.sin_port = htons(port);
+
+  // Convert IPv4 and IPv6 addresses from text to binary form
+  if(inet_pton(AF_INET, "127.0.0.1", &serv_addr.sin_addr)<=0)
+  {
+    printf("\nError in inet_pton - errno is %d\n", errno);
+    return -1;
+  }
+
+  if (connect(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
+  {
+    printf("\nError in connect - errno is %d \n", errno);
+    return -1;
+  }
+
+  return sock;
+}

+ 134 - 0
systemMain.cpp

@@ -0,0 +1,134 @@
+#include <string.h>
+#include <string>
+#include <unistd.h>
+#include <errno.h>
+
+#include <fcntl.h>
+#include <sys/types.h> 
+#include <sys/stat.h> 
+
+
+#include "ipc.h"
+#include "SgxLAInititator.h"
+#include "SealerWrapper.h"
+#include "SgxCrypto.h" 
+using namespace std;
+
+#define DECRYPTOR_PORT 3825
+#define SGX_HASH_SIZE 32
+int __ImageBase=0;
+int verify_apache(std::string& path, std::string& keypair) {return 0; }
+
+int local_attestation(int port, uint8_t* mr_enclave, uint8_t* mr_signer, uint8_t* send_mr_signer)
+{
+  int decryptor_fd;
+  setbuf(stdout,NULL);
+  decryptor_fd=set_up_socket_connect(port);
+  if(decryptor_fd!=-1)
+  {
+    printf("Set up a socket with the other module\n");
+    return create_session(decryptor_fd, mr_enclave, mr_signer, send_mr_signer);
+  }
+  else
+    return 0xFFFFFFFF;
+}
+
+int main(int argc, char** argv)
+{
+  // TODO: Generation of keys used to sign Apache Enclave.
+  uint8_t expected_apache_mr_signer[SGX_HASH_SIZE] = {0x3};
+  std::string apache_signature_keypair_private("1234567890");
+  std::string apache_public_key;
+  uint8_t decryptor_mr_enclave[SGX_HASH_SIZE] = {0x1};
+  uint8_t decryptor_mr_signer[SGX_HASH_SIZE] = {0x2};
+  uint32_t return_sgx; uint32_t return_internal;
+  std::string recovered_plaintext;
+  uint32_t expected_sealed_msg_size=0;
+/*
+  printf("about to generate rsa key pair\n");
+  fflush(stdout); 
+  return_sgx=create_rsa_key_pair_for_signing_manifest();
+  if(return_sgx!=0)
+  {
+	printf("Could not successfully create rsa key pair.\n"); 
+	fflush(stdout); 
+	return 0xFFFFFFFF;
+  }
+  printf("generated rsa key pair\n");
+  fflush(stdout); */
+
+  int sealed_file_fd = open("sealed_msg.txt", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+  if(sealed_file_fd == -1)
+  {
+    perror("\nError in opening or creating the file sealed_msg.txt - ");
+    fflush(stderr);
+    return 0xFFFFFFFF;
+  }
+  printf("\nSuccessfully opened a file to seal the apache signature keypair to.\n");
+  fflush(stdout);
+  return_sgx = seal_message_to_file(sealed_file_fd, apache_signature_keypair_private, &expected_sealed_msg_size);
+  if(return_sgx!=0 && return_sgx!=0xFFFFFFFF)
+  {
+    printf("Sealing SGX error %x", return_sgx);
+    fflush(stdout);
+    return return_sgx;
+  }
+  else if(return_sgx == 0xFFFFFFFF)
+  {
+    perror("Successful SGX sealing, but error in writing to a file or write returned 0 bytes because the disk was full etc.\n");
+    fflush(stdout);
+    return return_sgx;
+  }
+  printf("\n Successfully sealed the plaintext %s to length 0x%x.\n", apache_signature_keypair_private.c_str(), expected_sealed_msg_size);
+  fflush(stdout);
+
+  return_sgx = local_attestation(DECRYPTOR_PORT, decryptor_mr_enclave, decryptor_mr_signer, expected_apache_mr_signer);
+  if(return_sgx != 0)
+  {
+    if(return_sgx== 0xFFFFFFFF)
+    {
+      perror("\nCould not set up the socket: had the following error: ");
+      fflush(stderr);
+    }
+    else
+    {
+      printf("\nHad the following error in SGX local attestation: %d", return_sgx);
+      fflush(stdout);
+    }
+    return return_sgx;
+  }
+  printf("\nSuccessful LA with port %d.\n", DECRYPTOR_PORT);
+  fflush(stdout);
+
+  sleep(50);
+  printf("\n z z z z z z  z z z z z z z  (sleeping for a bit) z z z z z  z z z (meant to emulate the '2nd' stage of validator, that will be rerun whenever Apache changes)\n");
+  return_sgx = unseal_message_from_file(sealed_file_fd, recovered_plaintext, &expected_sealed_msg_size);
+  if(return_sgx!=0 && return_sgx!=0xFFFFFFFF)
+  {
+    printf("Successful read from file, but error in SGX unsealing: %x.\n", return_sgx);
+    fflush(stdout);
+    return return_sgx;
+  }
+  else if(return_sgx == 0xFFFFFFFF)
+  {
+    perror("\n Could not read the file.\n");
+    fflush(stdout);
+    return return_sgx;
+  }
+  printf("\n Unsealed the keypair.\n");
+  fflush(stdout);
+
+  std::string path("../apache/source/code/path");
+  return_internal = verify_apache(path, apache_signature_keypair_private);
+  if(return_internal != 0)
+  {
+    printf("\nThe signed manifest was not created due to the above errors.\n");
+    fflush(stdout);
+    return return_internal;
+  }
+  printf("Successfully verified the Apache enclave and signed its manifest.\n");
+  fflush(stdout);
+  return 0;
+
+
+}

+ 50 - 0
systemSealerWrapper.cpp

@@ -0,0 +1,50 @@
+#include <stdlib.h>
+#include <unistd.h> // Read/write
+#include <string>
+#include <iostream>
+#include <vector>
+#include "SgxSealer.h"
+
+//class SealerWrapper {
+uint32_t init() {
+  return initialize_pse_and_counter();
+}
+
+uint32_t seal_message_to_file(int fd, std::string& plaintext, uint32_t* actual_sealed_msg_length)
+{
+  uint32_t ret;  ssize_t bytes_written; std::string sgx_sealed_msg; 
+  ret = seal_message(plaintext, sgx_sealed_msg);
+  if(ret!=0)
+	return ret;
+
+  bytes_written = write(fd, sgx_sealed_msg.c_str(), sgx_sealed_msg.length());
+  if(bytes_written > 0)
+  {
+	fsync(fd);
+	*actual_sealed_msg_length = bytes_written;
+         return 0;
+  }
+  else
+	return 0xFFFFFFFF;
+
+}
+
+// need to return a msg of the length returned by the get_encrypt_txt_len call.
+uint32_t unseal_message_from_file(int fd, std::string& plaintext, uint32_t* expected_sealed_msg_length)
+{
+  uint32_t ret; ssize_t bytes_read; char* sgx_sealed_msg; std::string sgx_sealed_msg_str;
+  sgx_sealed_msg = (char*) malloc(*expected_sealed_msg_length);
+  lseek(fd, 0, SEEK_SET);
+  bytes_read = read(fd, sgx_sealed_msg, *expected_sealed_msg_length);
+  if(bytes_read <= 0)
+  {
+	free(sgx_sealed_msg);
+	return 0xFFFFFFFF;
+  }
+  sgx_sealed_msg_str = std::string(sgx_sealed_msg, *expected_sealed_msg_length);
+  free(sgx_sealed_msg);
+  ret = unseal_and_verify_sealed_message(sgx_sealed_msg_str, plaintext);
+  return ret;
+}
+
+//};

BIN
verifier