enclave { include "sgx_eid.h" include "sgx_tcrypto.h" #define SIZEOF_UINT32_T_ARRAY from "../LocalAttestationCode/LocalAttestationCode.edl" import *; from "/opt/intel/sgxssl/include/sgx_tsgxssl.edl" import * ; trusted { public void calculate_sealed_keypair_size_wrapper([out, size=4] uint32_t* output_length); #define SEALED_SIZE 656 // =0x300 (0x290 is the size of the sealed message when both the public(0x40) and private key(0x20) are included) 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); 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); 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 // Apache mrsigner = 32 bytes + tag on encryption = 16 bytes. // public uint32_t decrypt_verifiers_message_set_apache_mrsigner_wrapper([in, size=60] uint8_t* ciphertext_plus_tag); // 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 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, uint32_t no_of_fields, uint32_t total_input_size, [out, count=total_input_size] uint8_t *output_fields_list, [out, count=no_of_fields, size=4] uint32_t *output_field_sizes); 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); public uint32_t process_verifiers_message_wrapper([in, size=60] uint8_t* input_ciphertext, uint32_t length); public void get_verifier_mrenclave_apache_mrsigner_wrapper([out, size=64] uint8_t* output); public void get_short_term_public_key_wrapper([out, size=64] uint8_t* output); public void get_long_term_verification_key_wrapper([out, size=64] uint8_t* output); public void get_apache_iv([out, size=12] uint8_t* output); }; };