LAInitiator_Protobuf.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // Created by miti on 2019-12-21.
  3. //
  4. #ifndef VERIFIER_LAINITIATOR_PROTOBUFINTERFACE_H
  5. #define VERIFIER_LAINITIATOR_PROTOBUFINTERFACE_H
  6. #include "sgx_eid.h"
  7. #define __STDC_FORMAT_MACROS
  8. #include <inttypes.h>
  9. #include "ProtobufLAMessages.h"
  10. #include <stdio.h>
  11. #include "sgx_trts.h"
  12. #include "sgx_utils.h"
  13. #include "error_codes.h"
  14. #include "sgx_ecp_types.h"
  15. #include "sgx_thread.h"
  16. #include <map>
  17. #include "sgx_dh.h"
  18. #include "dh_session_protocol.h"
  19. #include "sgx_tcrypto.h"
  20. #include "datatypes.h"
  21. #include "Initiator_Transforms.h"
  22. #define MAX_SESSION_COUNT 16
  23. #define SGX_CAST(type, item) ((type)(item))
  24. #include <string.h>
  25. #include "crypto.h"
  26. #include "ProtobufMessageRW.h"
  27. class LAInitiator_Protobuf {
  28. sgx_dh_session_t sgx_dh_session;
  29. dh_session_t global_session_info;
  30. ProtobufMessageRW protobufReaderWriter;
  31. uint8_t key[16];
  32. uint32_t process_protobuf_dh_msg3(protobuf_sgx_dh_msg3_t& protobuf_msg3, uint32_t* session_id);
  33. uint32_t process_protobuf_dh_msg1_generate_protobuf_dh_msg2(protobuf_sgx_dh_msg1_t& protobuf_msg1, protobuf_sgx_dh_msg2_t& protobuf_msg2, uint32_t* session_id);
  34. public:
  35. uint32_t conduct_la();
  36. uint32_t get_la_symmetric_key(uint8_t* key);
  37. };
  38. // TODO: Get them to take in lists as inputs and change verifier's code too to put in elements into a list.
  39. // TODO: Revert php code back by two commits (before rollback) and edit from there.
  40. // TODO: Also get the decryptor codebase in sync with this format of sgx/protobuf files.
  41. #endif //LAINITIATOR_PROTOBUFINTERFACE_H