enclave_api.h 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_priv_out;
  11. uint8_t m_priv_in;
  12. uint8_t m_pub_out;
  13. uint8_t m_pub_in;
  14. sgx_aes_gcm_128bit_key_t master_secret;
  15. };
  16. #define ROLE_INGESTION 0x01
  17. #define ROLE_ROUTING 0x02
  18. #define ROLE_STORAGE 0x04
  19. struct EnclaveAPINodeConfig {
  20. sgx_ec256_public_t pubkey;
  21. uint8_t weight;
  22. uint8_t roles;
  23. };
  24. #define SEALED_PRIVKEY_SIZE 610
  25. #define TOKEN_SIZE SGX_CMAC_MAC_SIZE
  26. // Must be a multiple of 16
  27. #define FRAME_SIZE (65536+16)
  28. // Within a 32-bit word for a destination address, the numbers of bits
  29. // for the storage node number and the userid at that storage node
  30. #define DEST_STORAGE_NODE_BITS 10
  31. #define DEST_UID_BITS 22
  32. // Epoch timing configuration (in us)
  33. #define EPOCH_INTERVAL 2000000
  34. #endif