enclave_api.h 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __ENCLAVE_API_H__
  2. #define __ENCLAVE_API_H__
  3. #include "sgx_tcrypto.h"
  4. typedef uint16_t threadid_t;
  5. typedef uint16_t nodenum_t;
  6. typedef uint32_t clientid_t;
  7. struct EnclaveAPIParams {
  8. uint32_t user_count;
  9. uint16_t msg_size;
  10. uint8_t m_token_out;
  11. uint8_t m_token_in;
  12. uint8_t m_id_out;
  13. uint8_t m_id_in;
  14. sgx_aes_gcm_128bit_key_t master_secret;
  15. bool token_channel;
  16. };
  17. #define ROLE_INGESTION 0x01
  18. #define ROLE_ROUTING 0x02
  19. #define ROLE_STORAGE 0x04
  20. struct EnclaveAPINodeConfig {
  21. sgx_ec256_public_t pubkey;
  22. uint8_t weight;
  23. uint8_t roles;
  24. };
  25. #define SEALED_PRIVKEY_SIZE 610
  26. #define TOKEN_SIZE SGX_CMAC_MAC_SIZE
  27. // Must be a multiple of 16
  28. #define FRAME_SIZE (65536+16)
  29. // Within a 32-bit word for a destination address, the numbers of bits
  30. // for the storage node number and the userid at that storage node
  31. #define DEST_STORAGE_NODE_BITS 10
  32. #define DEST_UID_BITS 22
  33. #endif