Decryptor.edl 2.5 KB

123456789101112131415161718192021222324252627
  1. enclave {
  2. include "sgx_eid.h"
  3. include "sgx_tcrypto.h"
  4. #define SIZEOF_UINT32_T_ARRAY
  5. from "../LocalAttestationCode/LocalAttestationCode.edl" import *;
  6. from "/opt/intel/sgxssl/include/sgx_tsgxssl.edl" import * ;
  7. trusted {
  8. public void calculate_sealed_keypair_size_wrapper([out, size=4] uint32_t* output_length);
  9. #define SEALED_SIZE 656 // =0x300 (0x290 is the size of the sealed message when both the public(0x40) and private key(0x20) are included)
  10. public uint32_t create_and_seal_long_term_signing_key_pair_wrapper([out, size=4] uint32_t* sealed_data_length, [out,size=SEALED_SIZE] uint8_t* sealed_data);
  11. public uint32_t unseal_and_restore_long_term_signing_key_pair_wrapper([in, size=SEALED_SIZE] uint8_t* sealed_data, [in, size=4] uint32_t* sgx_sealed_data_length);
  12. public uint32_t create_and_encrypt_mitigator_header_H_wrapper([out, size=200] uint8_t* ciphertext_token_H_plus_tag, [out] uint32_t* length); // would be 188 in length
  13. // Apache mrsigner = 32 bytes + tag on encryption = 16 bytes.
  14. // public uint32_t decrypt_verifiers_message_set_apache_mrsigner_wrapper([in, size=60] uint8_t* ciphertext_plus_tag);
  15. // NEED AT LEAST: 64 bytes for public key of client, plus 64 bytes of signature over it, plus 16 bytes of tag over any encryption = 144 bytes. Msg length = 144 bytes + Length of form field
  16. public uint32_t decrypt_client_data_wrapper([in, count=total_input_size] uint8_t *input_fields_list, [in, count=no_of_fields, size=4] uint32_t *input_field_sizes,
  17. uint32_t no_of_fields, uint32_t total_input_size,
  18. [out, count=total_input_size] uint8_t *output_fields_list,
  19. [out, count=no_of_fields, size=4] uint32_t *output_field_sizes);
  20. public uint32_t process_apache_message_generate_response_wrapper([in, size=4100] uint8_t* input_ciphertext, uint32_t input_ciphertext_plus_tag_length, [out, size=4100] uint8_t* output_ciphertext, [out,size=4] uint32_t* output_ciphertext_plus_tag_length);
  21. public uint32_t process_verifiers_message_wrapper([in, size=60] uint8_t* input_ciphertext, uint32_t length);
  22. public void get_verifier_mrenclave_apache_mrsigner_wrapper([out, size=64] uint8_t* output);
  23. public void get_short_term_public_key_wrapper([out, size=64] uint8_t* output);
  24. public void get_long_term_verification_key_wrapper([out, size=64] uint8_t* output);
  25. public void get_apache_iv([out, size=12] uint8_t* output);
  26. };
  27. };