-
Notifications
You must be signed in to change notification settings - Fork 47
/
Enclave.edl
executable file
·99 lines (80 loc) · 3.4 KB
/
Enclave.edl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
Copyright 2019 Supercomputing Systems AG
Licensed 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 {
from "sgx_backtrace.edl" import *;
from "sgx_tstd.edl" import *;
from "sgx_stdio.edl" import *;
from "sgx_backtrace.edl" import *;
from "sgx_tstdc.edl" import *;
from "sgx_tprotected_fs.edl" import *;
from "sgx_fs.edl" import *;
from "sgx_net.edl" import *;
from "sgx_time.edl" import *;
from "sgx_env.edl" import *;
include "sgx_quote.h"
trusted {
/* define ECALLs here. */
public sgx_status_t call_counter_wasm(
[in, size=req_len] const uint8_t* req_bin, size_t req_len,
[in, size=ciphertext_size] uint8_t* ciphertext, uint32_t ciphertext_size,
[in, size=hash_size] uint8_t* hash, uint32_t hash_size,
[in, size=nonce_size] uint8_t* nonce, uint32_t nonce_size,
[in, size=wasm_hash_size] uint8_t* wasm_hash, uint32_t wasm_hash_size,
[out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size
);
public sgx_status_t get_counter(
[in, size=account_size] uint8_t* account, uint32_t account_size,
[out] uint32_t* counter_value);
public sgx_status_t get_rsa_encryption_pubkey(
[out, size=pubkey_size] uint8_t* pubkey, uint32_t pubkey_size);
public sgx_status_t get_ecc_signing_pubkey(
[out, size=pubkey_size] uint8_t* pubkey, uint32_t pubkey_size);
public sgx_status_t sgxwasm_init();
public sgx_status_t perform_ra(
[in, size=genesis_hash_size] uint8_t* genesis_hash, uint32_t genesis_hash_size,
[in, size=nonce_size] uint8_t* nonce, uint32_t nonce_size,
[in, size=url_size] uint8_t* url, uint32_t url_size,
[out, size=unchecked_extrinsic_size] uint8_t* unchecked_extrinsic, uint32_t unchecked_extrinsic_size
);
public sgx_status_t run_server(int fd,sgx_quote_sign_type_t quote_type);
public sgx_status_t run_client(int fd,sgx_quote_sign_type_t quote_type);
public size_t test_main_entrance();
};
untrusted {
sgx_status_t ocall_sgx_init_quote(
[out] sgx_target_info_t *ret_ti,
[out] sgx_epid_group_id_t *ret_gid
);
sgx_status_t ocall_get_ias_socket([out] int *ret_fd);
sgx_status_t ocall_get_quote(
[in, size = sigrl_len] uint8_t * p_sigrl, uint32_t sigrl_len,
[in] sgx_report_t *report, sgx_quote_sign_type_t quote_type,
[in] sgx_spid_t *p_spid, [in] sgx_quote_nonce_t *p_nonce,
[out] sgx_report_t *p_qe_report,
[out, size = maxlen] sgx_quote_t *p_quote, uint32_t maxlen,
[out] uint32_t* p_quote_len
);
sgx_status_t ocall_get_update_info(
[in] sgx_platform_info_t * platformBlob, int32_t enclaveTrusted,
[out] sgx_update_info_bit_t * update_info
);
sgx_status_t ocall_read_ipfs(
[out, size = state_size] uint8_t * enc_state, uint32_t state_size,
[in, size = cid_size] uint8_t * cid, uint32_t cid_size
);
sgx_status_t ocall_write_ipfs(
[in, size = state_size] uint8_t * enc_state, uint32_t state_size,
[out, size = cid_size] uint8_t * cid, uint32_t cid_size
);
};
};