@@ -181,14 +181,14 @@ Goal True.
181
181
Abort .
182
182
183
183
Definition protocol_step : state -> list MMIO -> state -> Prop :=
184
- fun '(Build_state seed sk ) ioh '(Build_state SEED SK) =>
184
+ fun '(Build_state seed x25519_ephemeral_secret ) ioh '(Build_state SEED SK) =>
185
185
(lightbulb_spec.lan9250_recv_no_packet _ ioh \/
186
186
lightbulb_spec.lan9250_recv_packet_too_long _ ioh \/
187
- TracePredicate.concat TracePredicate.any (lightbulb_spec.spi_timeout _) ioh) /\ SEED=seed /\ SK=sk \/
187
+ TracePredicate.concat TracePredicate.any (lightbulb_spec.spi_timeout _) ioh) /\ SEED=seed /\ SK=x25519_ephemeral_secret \/
188
188
(exists incoming, lightbulb_spec.lan9250_recv _ incoming ioh /\
189
189
let ethertype := le_combine (rev (firstn 2 (skipn 12 incoming))) in ethertype < 1536 \/
190
190
let ipproto := nth 23 incoming x00 in (ipproto <> x11 \/
191
- length incoming <> 14+20+8 +2+16 +4 /\ length incoming <> 14+20+8 +2+32 +4)%nat) /\ SEED=seed /\ SK=sk \/
191
+ length incoming <> 14+20+8 +2+16 +4 /\ length incoming <> 14+20+8 +2+32 +4)%nat) /\ SEED=seed /\ SK=x25519_ephemeral_secret \/
192
192
exists (mac_local mac_remote : tuple byte 6),
193
193
exists (ethertype : Z) (ih_const : tuple byte 2) (ip_length : Z) (ip_idff : tuple byte 5),
194
194
exists (ipproto := x11) (ip_checksum : Z) (ip_local ip_remote : tuple byte 4),
@@ -209,28 +209,29 @@ Definition protocol_step : state -> list MMIO -> state -> Prop :=
209
209
(TracePredicate.one ("st", lightbulb_spec.GPIO_DATA_ADDR _, action))) ioh
210
210
/\ (
211
211
let m := firstn 16 garagedoor_payload in
212
- let v := x25519_spec sk garageowner_P in
212
+ let v := x25519_spec x25519_ephemeral_secret garageowner_P in
213
213
exists set0 set1 : Naive.word32,
214
214
(word.unsigned set0 = 1 <-> firstn 16 v = m) /\
215
215
(word.unsigned set1 = 1 <-> skipn 16 v = m) /\
216
216
action = word.or (word.and doorstate (word.of_Z (Z.clearbit (Z.clearbit (2^32-1) 11) 12))) (word.slu (word.or (word.slu set1 (word.of_Z 1)) set0) (word.of_Z 11)) /\
217
- (word.unsigned (word.or set0 set1) = 0 -> SEED=seed /\ SK=sk ) /\
217
+ (word.unsigned (word.or set0 set1) = 0 -> SEED=seed /\ SK=x25519_ephemeral_secret ) /\
218
218
(word.unsigned (word.or set0 set1) <> 0 -> SEED++SK = RupicolaCrypto.Spec.chacha20_block seed (ChaCha20.le_split 4 (word.of_Z 0) ++ firstn 12 garageowner))
219
219
)) \/
220
220
TracePredicate.concat (lightbulb_spec.lan9250_recv _ incoming)
221
221
(lightbulb_spec.lan9250_send _
222
222
(let ip_length := 62 in
223
223
let udp_length := 42 in
224
+
224
225
mac_remote ++ mac_local ++ be2 ethertype ++
225
- let ih C := ih_const ++ be2 ip_length ++
226
- ip_idff ++ [ipproto] ++ le_split 2 C ++
227
- ip_local ++ ip_remote in
228
- ih (Spec.ip_checksum (ih 0)) ++
229
- udp_local ++ udp_remote ++
230
- be2 udp_length ++ be2 0 ++
226
+ let ip_hdr checksum := ih_const ++ be2 ip_length ++
227
+ ip_idff ++ [ipproto] ++ le_split 2 checksum ++
228
+ ip_local ++ ip_remote in
229
+ ip_hdr (IPChecksum.Spec.ip_checksum (ip_hdr 0)) ++
230
+ udp_local ++ udp_remote ++ be2 udp_length ++ be2 0 ++
231
231
garagedoor_header ++
232
- x25519_spec sk Curve25519.M.B))
233
- ioh /\ SEED=seed /\ SK=sk.
232
+ x25519_spec x25519_ephemeral_secret Curve25519.M.B
233
+
234
+ )) ioh /\ SEED=seed /\ SK=x25519_ephemeral_secret.
234
235
235
236
Local Instance spec_of_recvEthernet : spec_of "recvEthernet" := spec_of_recvEthernet.
236
237
Local Instance spec_of_lan9250_tx : spec_of "lan9250_tx" := spec_of_lan9250_tx.
0 commit comments