ZT.hpp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * ZeroTrace: Oblivious Memory Primitives from Intel SGX
  3. * Copyright (C) 2018 Sajin (sshsshy)
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 3 of the License.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. int8_t ZT_Initialize(unsigned char *bin_x, unsigned char *bin_y, unsigned char *bin_r, unsigned char *bin_s, uint32_t buff_size);
  18. void ZT_Close();
  19. uint32_t ZT_New( uint32_t max_blocks, uint32_t data_size, uint32_t stash_size, uint32_t oblivious_flag, uint32_t recursion_data_size, uint32_t oram_type, uint8_t pZ);
  20. uint32_t ZT_New_LSORAM( uint32_t num_blocks, uint32_t key_size, uint32_t value_size, uint8_t mode, uint8_t oblivious_type, uint8_t populate_flag);
  21. void ZT_Access(uint32_t instance_id, uint8_t oram_type, unsigned char *encrypted_request, unsigned char *encrypted_response, unsigned char *tag_in, unsigned char* tag_out, uint32_t request_size, uint32_t response_size, uint32_t tag_size);
  22. void ZT_Bulk_Read(uint32_t instance_id, uint8_t oram_type, uint32_t bulk_batch_size, unsigned char *encrypted_request, unsigned char *encrypted_response, unsigned char *tag_in, unsigned char* tag_out, uint32_t request_size, uint32_t response_size, uint32_t tag_size);
  23. //LSORAM Access-oblivious API
  24. int8_t ZT_LSORAM_insert(uint32_t instance_id, unsigned char *encrypted_request, uint32_t request_size,
  25. unsigned char* tag_in, uint32_t tag_size, unsigned char *client_pubkey, uint32_t pubkey_size_x,
  26. uint32_t pubkey_size_y);
  27. int8_t ZT_LSORAM_fetch(uint32_t instance_id, unsigned char *encrypted_request,
  28. uint32_t request_size, unsigned char *encrypted_response,
  29. uint32_t response_size, unsigned char* tag_in, unsigned char* tag_out,
  30. uint32_t tag_size, unsigned char *client_pubkey, uint32_t pubkey_size_x,
  31. uint32_t pubkey_size_y);
  32. int8_t ZT_HSORAM_insert(uint32_t lsoram_iid, uint32_t oram_iid, uint8_t oram_type,
  33. uint32_t oram_index, unsigned char *encrypted_request, uint32_t request_size,
  34. unsigned char* tag_in, uint32_t tag_size, unsigned char *client_pubkey,
  35. uint32_t pubkey_size_x, uint32_t pubkey_size_y);
  36. int8_t ZT_HSORAM_fetch(uint32_t lsoram_iid, uint32_t oram_iid, uint8_t oram_type,
  37. unsigned char *encrypted_request, uint32_t request_size,
  38. unsigned char *encrypted_response, uint32_t response_size,
  39. unsigned char* tag_in, unsigned char* tag_out, uint32_t tag_size,
  40. unsigned char *client_pubkey, uint32_t pubkey_size_x,
  41. uint32_t pubkey_size_y);
  42. int8_t ZT_LSORAM_evict(uint32_t id, unsigned char *key, uint32_t key_size);
  43. void ZT_LSORAM_delete(uint32_t id);
  44. //LSORAM Full-olivious API
  45. //void ZT_LSORAM_Access();