protobufSgxTransformsHelper.h 1.3 KB

123456789101112131415161718192021222324252627282930
  1. //
  2. // Created by miti on 21/07/19.
  3. //
  4. #ifndef DECRYPTORAPP_PROTOBUFSGXTRANSFORMSHELPER_H
  5. #define DECRYPTORAPP_PROTOBUFSGXTRANSFORMSHELPER_H
  6. #include "ProtobufLAMessages.pb.h"
  7. #define __STDC_FORMAT_MACROS
  8. #include <inttypes.h>
  9. #include <stdio.h>
  10. #include "sgx_report.h"
  11. #include "sgx_eid.h"
  12. #include "sgx_dh.h"
  13. #define SGX_REPORT_BODY_RESERVED1 28
  14. #define SGX_REPORT_BODY_RESERVED2 32
  15. #define SGX_REPORT_BODY_RESERVED3 96
  16. #define SGX_REPORT_BODY_RESERVED4 60
  17. namespace protobufSgxTransformsHelper {
  18. void encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a);
  19. int decode_ec256_public_key_from_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a);
  20. void encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes);
  21. int decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes);
  22. void encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report);
  23. int decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report);
  24. int fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8);
  25. };
  26. #endif //DECRYPTORAPP_PROTOBUFSGXTRANSFORMSHELPER_H