Skip to content

Commit 5f5a917

Browse files
committed
chore(re-organise project): rename trusted_compute into soc
1 parent aa0222c commit 5f5a917

File tree

5 files changed

+227
-227
lines changed

5 files changed

+227
-227
lines changed

_CoqProject

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ theories/examples/macros/macros.v
104104
# Template Adequacy
105105
theories/examples/template_adequacy_attestation.v
106106

107-
# Trusted Compute example
108-
theories/examples/soc/trusted_compute_code.v
109-
theories/examples/soc/trusted_compute_enclave_spec.v
110-
theories/examples/soc/trusted_compute_spec.v
111-
theories/examples/soc/trusted_compute_adequacy.v
107+
# Secure Outsources Computation (SOC) example
108+
theories/examples/soc/soc_code.v
109+
theories/examples/soc/soc_enclave_spec.v
110+
theories/examples/soc/soc_spec.v
111+
theories/examples/soc/soc_adequacy.v
112112

113113
# Trusted Memory Readout example
114114
theories/examples/memory_readout/trusted_memory_readout_code.v
@@ -119,7 +119,7 @@ theories/examples/memory_readout/trusted_memory_readout_sensor_spec.v
119119
theories/examples/memory_readout/trusted_memory_readout_main_spec.v
120120
theories/examples/memory_readout/trusted_memory_readout_adequacy.v
121121

122-
# Mutual attestation example
122+
# Mutual Attestation example
123123
theories/examples/mutual_attestation/mutual_attestation_code.v
124124
theories/examples/mutual_attestation/mutual_attestation_A_spec.v
125125
theories/examples/mutual_attestation/mutual_attestation_B_spec.v

theories/examples/soc/trusted_compute_adequacy.v renamed to theories/examples/soc/soc_adequacy.v

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ From cap_machine Require Import proofmode.
44
From cap_machine Require Import assert macros.
55
From cap_machine Require Import template_adequacy_attestation.
66
From cap_machine Require Import
7-
trusted_compute_code
8-
trusted_compute_enclave_spec
9-
trusted_compute_spec
7+
soc_code
8+
soc_enclave_spec
9+
soc_spec
1010
.
1111

1212
(** MEMORY LAYOUT: The end-to-end theorem only relies on this layout. *)
1313
Class memory_layout `{MachineParameters} := {
1414
(* Verifier code *)
1515
verifier_start : Addr;
1616
verifier_end : Addr;
17-
verifier_size: (verifier_start + trusted_compute_main_len = Some verifier_end)%a;
17+
verifier_size: (verifier_start + soc_main_len = Some verifier_end)%a;
1818
verifier_region: list Addr;
1919
verifier_region_correct:
2020
verifier_region = (finz.seq_between verifier_start verifier_end);
@@ -62,30 +62,30 @@ Class memory_layout `{MachineParameters} := {
6262
adv_region ## link_table_region ∧
6363
l_assert_region ## link_table_region;
6464

65-
(* TC enclave *)
66-
tc_enclave_start : Addr;
65+
(* SOC enclave *)
66+
soc_enclave_start : Addr;
6767
}.
6868

6969
Definition link_cap `{memory_layout} :=
7070
WCap RO link_table_start link_table_end link_table_start.
7171

7272
(** Instantiation of the layout. *)
7373

74-
(** 1) Instantiate the class specific to the TC enclave *)
75-
Local Instance trusted_compute_concrete `{memory_layout} : TrustedCompute.
76-
Proof. apply (Build_TrustedCompute tc_enclave_start). Defined.
74+
(** 1) Instantiate the class specific to the SOC enclave *)
75+
Local Instance soc_concrete `{memory_layout} : SecureOutsourcedCompute.
76+
Proof. apply (Build_SecureOutsourcedCompute soc_enclave_start). Defined.
7777

7878
(** 2) Instantiate the verifier's program.
79-
It is given by the code in `trusted_compute_main_code`
79+
It is given by the code in `soc_main_code`
8080
followed by the link capability and a data capability.
8181
*)
82-
Program Definition tc_verifier_prog `{memory_layout} : prog :=
83-
let a_data := (verifier_start ^+ trusted_compute_main_code_len)%a in
82+
Program Definition soc_verifier_prog `{memory_layout} : prog :=
83+
let a_data := (verifier_start ^+ soc_main_code_len)%a in
8484
let data_cap := WCap RWX verifier_start verifier_end a_data in
8585
{| prog_start := verifier_start ;
8686
prog_end := verifier_end ;
8787
prog_instrs :=
88-
(lword_get_word <$> (trusted_compute_main_code 0))
88+
(lword_get_word <$> (soc_main_code 0))
8989
++ [link_cap ; data_cap];
9090
prog_size := _ |}.
9191
Next Obligation.
@@ -147,20 +147,20 @@ Definition link_tbl `{memory_layout} : assert_tbl :=
147147
|}.
148148

149149
(** 6) Align the full_run_spec with the specification of the adequacy. *)
150-
Section tc_adequacy.
150+
Section soc_adequacy.
151151
Context {Σ:gFunctors}
152152
`{MP: MachineParameters}
153153
{ceriseg:ceriseG Σ} {sealsg: sealStoreG Σ}
154154
{nainv: logrel_na_invs Σ}
155155
{memlayout: memory_layout}
156156
.
157157

158-
Definition trusted_computeN : namespace := nroot .@ "trusted_compute".
159-
Definition link_tableN := (trusted_computeN.@"link_table").
160-
Definition tc_mainN := (trusted_computeN.@"main").
161-
Lemma tc_correct ecur etbl :
158+
Definition socN : namespace := nroot .@ "soc".
159+
Definition link_tableN := (socN.@"link_table").
160+
Definition soc_mainN := (socN.@"main").
161+
Lemma soc_correct ecur etbl :
162162
let vinit := 0%nat in
163-
let P := tc_verifier_prog in
163+
let P := soc_verifier_prog in
164164
let Adv := adv_prog in
165165
let RA := reserved_addresses_assert AssertLib vinit in
166166
let r_adv := r_t0 in
@@ -260,23 +260,23 @@ Section tc_adequacy.
260260
}
261261

262262
(* 4 - Allocate invariant of the code *)
263-
set (a_data := (prog_start P ^+ length (trusted_compute_main_code 0))%a).
263+
set (a_data := (prog_start P ^+ length (soc_main_code 0))%a).
264264
set (link_capL := word_to_lword link_cap vinit).
265-
iMod (na_inv_alloc logrel_nais ⊤ tc_mainN
266-
(codefrag (prog_start P) vinit (trusted_compute_main_code 0)
265+
iMod (na_inv_alloc logrel_nais ⊤ soc_mainN
266+
(codefrag (prog_start P) vinit (soc_main_code 0)
267267
∗ (a_data, vinit) ↦ₐ link_capL
268268
∗ ((a_data ^+ 1)%a, vinit) ↦ₐ LCap RWX (prog_start P) (prog_end P) a_data vinit)
269269
with "[Hprog]") as "#Hprog".
270270
{ iNext.
271271
replace (prog_region P)
272272
with
273273
(mkregion verifier_start verifier_end
274-
((lword_get_word <$> trusted_compute_main_code 0) ++
274+
((lword_get_word <$> soc_main_code 0) ++
275275
[link_cap;
276-
WCap RWX verifier_start verifier_end (verifier_start ^+ trusted_compute_main_code_len)%a])
276+
WCap RWX verifier_start verifier_end (verifier_start ^+ soc_main_code_len)%a])
277277
) by done.
278278
pose proof verifier_size as Hsize_verifier.
279-
rewrite /trusted_compute_main_len in Hsize_verifier.
279+
rewrite /soc_main_len in Hsize_verifier.
280280
rewrite mkregion_app; last done.
281281
rewrite memory_to_lmemory_union.
282282
iDestruct (big_sepM_union with "Hprog") as "[Hprog Hdata]".
@@ -286,7 +286,7 @@ Section tc_adequacy.
286286
+ rewrite fmap_length.
287287
rewrite finz_seq_between_length.
288288
apply finz_dist_add.
289-
exists (verifier_start ^+ length (trusted_compute_main_code 0))%a.
289+
exists (verifier_start ^+ length (soc_main_code 0))%a.
290290
cbn in *.
291291
solve_addr.
292292
+ apply Forall_forall.
@@ -304,8 +304,8 @@ Section tc_adequacy.
304304
rewrite finz_dist_0; last solve_addr.
305305
done.
306306
}
307-
replace ([link_cap; WCap RWX verifier_start verifier_end (verifier_start ^+ trusted_compute_main_code_len)%a])
308-
with ([link_cap]++[WCap RWX verifier_start verifier_end (verifier_start ^+ trusted_compute_main_code_len)%a]); last by cbn.
307+
replace ([link_cap; WCap RWX verifier_start verifier_end (verifier_start ^+ soc_main_code_len)%a])
308+
with ([link_cap]++[WCap RWX verifier_start verifier_end (verifier_start ^+ soc_main_code_len)%a]); last by cbn.
309309
rewrite mkregion_app; last solve_addr.
310310
rewrite memory_to_lmemory_union.
311311
iDestruct (big_sepM_union with "Hdata") as "[Hdata1 Hdata2]".
@@ -355,8 +355,8 @@ Section tc_adequacy.
355355
rewrite finz_seq_between_empty; last solve_addr.
356356
iDestruct (big_sepM_insert_delete with "Hdata2") as "[$ _]".
357357
}
358-
iAssert (tc_main_inv verifier_start verifier_end vinit (trusted_compute_main_code 0) a_data
359-
link_capL tc_mainN) with "Hprog" as "#Hprog_inv".
358+
iAssert (soc_main_inv verifier_start verifier_end vinit (soc_main_code 0) a_data
359+
link_capL soc_mainN) with "Hprog" as "#Hprog_inv".
360360

361361
(* 5 - Allocate invariant of the assert *)
362362
iAssert (assert_inv (assert_start AssertLib) (assert_flag AssertLib) (assert_end AssertLib)
@@ -386,7 +386,7 @@ Section tc_adequacy.
386386
}
387387

388388
pose proof ( verifier_size ) as Hverifier_size.
389-
replace verifier_end with (verifier_start ^+ trusted_compute_main_len)%a by solve_addr.
389+
replace verifier_end with (verifier_start ^+ soc_main_len)%a by solve_addr.
390390

391391
(* 6 - Apply the full_run spec *)
392392
iApply (wp_wand _ _ _
@@ -395,18 +395,18 @@ Section tc_adequacy.
395395
∗ na_own logrel_nais ⊤) ∨ ⌜v0 = FailedV⌝)%I
396396
with "[-]")
397397
; last (by iIntros (v) "H").
398-
iApply (trusted_compute_full_run_spec with
398+
iApply (soc_full_run_spec with
399399
"[$Hadv $Hsystem_inv $Hinv_link $Hassert $Hprog_inv $Hflag_inv ] [ $HPC $Hown $Hr_adv $Hrmap]"); auto.
400400
+ solve_ndisj.
401401
+ solve_ndisj.
402402
+ solve_ndisj.
403-
+ subst P; rewrite /tc_verifier_prog /=.
403+
+ subst P; rewrite /soc_verifier_prog /=.
404404
solve_addr.
405405
+ rewrite /SubBounds.
406406
split; first solve_addr.
407407
split; last solve_addr.
408-
subst P; rewrite /tc_verifier_prog /=.
409-
rewrite /trusted_compute_main_len.
408+
subst P; rewrite /soc_verifier_prog /=.
409+
rewrite /soc_main_len.
410410
solve_addr.
411411
+ pose proof link_table_size.
412412
cbn; solve_addr.
@@ -417,16 +417,16 @@ Section tc_adequacy.
417417
by rewrite dom_fmap_L.
418418
Qed.
419419

420-
End tc_adequacy.
420+
End soc_adequacy.
421421

422422

423423
(** END-TO-END THEOREM *)
424-
Theorem tc_enclaves_adequacy `{memory_layout}
424+
Theorem soc_enclaves_adequacy `{memory_layout}
425425
(m m': Mem) (reg reg': Reg) (etbl etbl' : ETable) (ecur ecur' : ENum)
426426
(es: list cap_lang.expr):
427-
is_initial_memory tc_verifier_prog adv_prog AssertLib link_tbl m →
427+
is_initial_memory soc_verifier_prog adv_prog AssertLib link_tbl m →
428428
is_complete_memory m →
429-
is_initial_registers tc_verifier_prog adv_prog AssertLib link_tbl reg r_t0 →
429+
is_initial_registers soc_verifier_prog adv_prog AssertLib link_tbl reg r_t0 →
430430
is_complete_registers reg m →
431431
is_initial_etable etbl ecur →
432432
Forall (λ w, is_z w = true \/ in_region w adv_start adv_end) (prog_instrs adv_prog) →
@@ -437,10 +437,10 @@ Theorem tc_enclaves_adequacy `{memory_layout}
437437
Proof.
438438
intros ? ? ? ? ? Hints.
439439
set (Σ' := #[]).
440-
pose proof (template_adequacy Σ' tc_verifier_prog adv_prog AssertLib link_tbl) as Hadequacy.
440+
pose proof (template_adequacy Σ' soc_verifier_prog adv_prog AssertLib link_tbl) as Hadequacy.
441441
eapply Hadequacy;eauto.
442442
- eapply adequacy_flag_inv_is_initial_memory; eauto.
443443
- intros Σ ? ? ? ? ? ?.
444444
iIntros "(?&?&?&?&?&?&?&?&?&?&?)".
445-
iApply tc_correct; eauto; last iFrame.
445+
iApply soc_correct; eauto; last iFrame.
446446
Qed.

0 commit comments

Comments
 (0)