lib_rats_common.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2022 Intel Corporation
  3. * Copyright (c) 2020-2021 Alibaba Cloud
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. */
  7. #ifndef _RATS_WAMR_COMMON_H
  8. #define _RATS_WAMR_COMMON_H
  9. #include <stdint.h>
  10. #include <stddef.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define SGX_QUOTE_MAX_SIZE 8192
  15. #define SGX_USER_DATA_SIZE 64
  16. #define SGX_MEASUREMENT_SIZE 32
  17. /* clang-format off */
  18. typedef struct rats_sgx_evidence {
  19. uint8_t quote[SGX_QUOTE_MAX_SIZE]; /* The quote of the Enclave */
  20. uint32_t quote_size; /* The size of the quote */
  21. uint8_t user_data[SGX_USER_DATA_SIZE]; /* The custom data in the quote */
  22. uint32_t product_id; /* Product ID of the Enclave */
  23. uint8_t mr_enclave[SGX_MEASUREMENT_SIZE]; /* The MRENCLAVE of the Enclave */
  24. uint32_t security_version; /* Security Version of the Enclave */
  25. uint8_t mr_signer[SGX_MEASUREMENT_SIZE]; /* The MRSIGNER of the Enclave */
  26. uint64_t att_flags; /* Flags of the Enclave in attributes */
  27. uint64_t att_xfrm; /* XSAVE Feature Request Mask */
  28. } rats_sgx_evidence_t;
  29. /* clang-format on */
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif