This repository has been archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathEnclave.edl
119 lines (96 loc) · 3.74 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Copyright 2020 ADVANCA PTE. LTD.
// 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 {
include "sgx_key_exchange.h"
include "sgx_trts.h"
include "sgx_quote.h"
from "sgx_tkey_exchange.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 *;
trusted {
/* define ECALLs here. */
public sgx_status_t enclave_init();
public sgx_status_t create_storage(
[in, size=public_key_size] uint8_t* public_key, uint32_t public_key_size
);
public sgx_status_t storage_request(
[in, size=request_size] uint8_t* request, uint32_t request_size,
[out, size=response_capacity] uint8_t* response, uint32_t response_capacity,
[out] uint32_t* response_size
);
public sgx_status_t demo_compute(
[in, size=request_size] uint8_t* request, uint32_t request_size,
[out, size=response_capacity] uint8_t* response, uint32_t response_capacity,
[out] uint32_t* response_size
);
public sgx_status_t demo_leak(
[out] size_t *leaked_ptr
);
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 proc_heartbeat (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size,
[in, count=msg_len] uint8_t *msg,
size_t msg_len
);
public sgx_status_t gen_worker_key (
);
public sgx_status_t get_worker_sr25519_pubkey (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size
);
public sgx_status_t get_task_sr25519_pubkey (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size,
[in, count=32] uint8_t *task_id
);
public sgx_status_t get_worker_ec256_pubkey (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size
);
public sgx_status_t get_task_ec256_pubkey (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size,
[in, count=32] uint8_t *task_id
);
public sgx_status_t gen_worker_reg_request (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size,
sgx_ra_context_t context
);
public sgx_status_t accept_task (
[in, size=32] uint8_t *task_id,
[in, size=user_pubkey_secp256r1_size] uint8_t *user_pubkey_secp256r1,
size_t user_pubkey_secp256r1_size,
[in, size=user_pubkey_sr25519_size] uint8_t *user_pubkey_sr25519,
size_t user_pubkey_sr25519_size
);
public sgx_status_t encrypt_msg (
[user_check] uint8_t *ubuf,
[in,out] size_t *ubuf_size,
[in, count=32] uint8_t *task_id,
[in, count=msg_in_len] uint8_t *msg_in,
size_t msg_in_len
);
};
untrusted {
/* define OCALLs here. */
};
};