| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations |
| // under the License. |
| |
| enclave { |
| include "sgx_key_exchange.h" |
| include "sgx_trts.h" |
| |
| from "sgx_tkey_exchange.edl" import *; |
| from "sgx_tstd.edl" import *; |
| from "sgx_stdio.edl" import *; |
| from "sgx_backtrace.edl" import *; |
| |
| trusted { |
| |
| public sgx_status_t initialize(); |
| public void uninitialize(); |
| public sgx_status_t enclave_init_ra(int b_pse, [out] sgx_ra_context_t *p_context); |
| |
| public sgx_status_t enclave_ra_close(sgx_ra_context_t context); |
| |
| public sgx_status_t verify_att_result_mac(sgx_ra_context_t context, |
| [in, size=message_size] uint8_t* message, |
| size_t message_size, |
| [in] uint8_t mac[16]); |
| |
| public sgx_status_t verify_secret_data(sgx_ra_context_t context, |
| [in,size=secret_size] uint8_t* secret, |
| uint32_t secret_size, |
| [in] uint8_t gcm_mac[16], |
| uint32_t max_verification_length, |
| [out] uint8_t salt[32], |
| [out] uint8_t salt_mac[16], |
| [out] uint32_t *id); |
| |
| public sgx_status_t add_hash_data(uint32_t id, |
| sgx_ra_context_t context, |
| [in, size=hash_size] uint8_t* hashdata, |
| size_t hash_size, |
| [in] uint8_t mac[16]); |
| |
| public sgx_status_t get_result_size(uint32_t id, [out] size_t *len); |
| |
| public sgx_status_t get_result(uint32_t id, |
| sgx_ra_context_t context, |
| [out, size=result_size] uint8_t* result, |
| size_t result_size, |
| [out] uint8_t result_mac[16]); |
| }; |
| |
| }; |
| |