Browse Source

Slight reorganising.

tabularasa
Thomas Kerber 6 months ago
parent
commit
1a813a3c9e
Signed by: Thomas Kerber <t.kerber@ed.ac.uk> GPG Key ID: 8489B911F9ED617B
2 changed files with 10 additions and 8 deletions
  1. 4
    3
      Yggdrasil/Examples/SecureChannel.agda
  2. 6
    5
      Yggdrasil/Security.agda

+ 4
- 3
Yggdrasil/Examples/SecureChannel.agda View File

@@ -3,6 +3,7 @@ module Yggdrasil.Examples.SecureChannel where
3 3
 open import Data.Bool using (Bool; true; false; if_then_else_)
4 4
 open import Data.List using (List; []; _∷_)
5 5
 open import Data.Maybe using (Maybe; just; nothing)
6
+open import Data.Nat using (_*_)
6 7
 open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩)
7 8
 open import Level using (Level; Lift; lift)
8 9
 open import Relation.Binary.PropositionalEquality using (refl)
@@ -158,8 +159,8 @@ secure : {ℓ : Level} → (M C PK L : Set ℓ) → (l : M → L) →
158 159
   (pk?= : PK → PK → Bool) → (c?= : C → C → Bool) → 
159 160
   πᵢ-SecureChannel M L l ≃ πᵣ-SecureChannel M C PK L l pk?= c?=
160 161
 secure {ℓ} M C PK L l pk?= c?= = record
161
-  { g-exec-min = ?
162
-  ; g-sim-min  = ?
162
+  { sim-gas    = λ _ → 1000
163
+  ; gas-map    = _* 10
163 164
   ; simulator  = S-SecureChannel M C PK L l pk?= c?=
164
-  ; proof      = ?
165
+  ; proof      = λ{ g (strat α O) → ? }
165 166
   }

+ 6
- 5
Yggdrasil/Security.agda View File

@@ -113,14 +113,15 @@ simulated-strategy S str g = strat
113 113
 record Adv[_,_]≤_ {ℓ : Level} (πᵢ πᵣ : World ℓ) (ε : ℚ) :
114 114
     Set (lsuc (lsuc ℓ)) where
115 115
   field
116
-    g-exec-min :
117
-    g-sim-min :
116
+    sim-gas : Strategy (World.Γ πᵣ) Guess →
117
+    gas-map : ℕ →
118 118
     simulator : Simulator πᵢ πᵣ
119
-    proof : (g-exec g-sim : ℕ) → g-exec-min ≤ g-exec → g-sim-min ≤ g-sim →
119
+    proof : (g : ℕ) →
120 120
       (str : Strategy (World.Γ πᵣ) Guess) →
121
-      (⌊exec⌋ (simulated-strategy simulator str g-sim) (World.Σ πᵢ) g-exec)
121
+      (⌊exec⌋ (simulated-strategy simulator str (sim-gas str)) (World.Σ πᵢ)
122
+        (gas-map g))
122 123
         ≈[ ε ]≈
123
-      (⌊exec⌋ str (World.Σ πᵣ) g-exec)
124
+      (⌊exec⌋ str (World.Σ πᵣ) g)
124 125
 
125 126
 _≃_ : {ℓ : Level} → (πᵢ πᵣ : World ℓ) → Set (lsuc (lsuc ℓ))
126 127
 πᵢ ≃ πᵣ = Adv[ πᵢ , πᵣ ]≤ 0

Loading…
Cancel
Save