-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpke.auth.outsider-auth.proof
7747 lines (7598 loc) · 441 KB
/
hpke.auth.outsider-auth.proof
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Initial state
Game 1 is
((
foreach i <= N do
Osetup() :=
let (the_sk: skey_t, the_pk: pkey_t) = (s <-R keypairseed_t; (skgen(s), pkgen(s))) in
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
let SealAuth_Some(enc_6: kemciph_t, ct_10: bitstring) = (let SetupAuthS_Some(enc_5: kemciph_t, ctx_7: context_t) = (let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = (pk_1: pkey_t <- pk_2; sk: skey_t <- the_sk; k <-R kemseed_t; AuthEncap_r(k, pk_1, sk)) in let KeySchedule_Some(ctx_6: context_t) = (let concat(key_6: key_t, nonce_6: nonce_t) = (r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5); concat(get1(r_3), get2(r_3))) in KeySchedule_Some(Context(key_6, nonce_6, nonce_zero)) else KeySchedule_None) in SetupAuthS_Some(enc_4, ctx_6) else SetupAuthS_None else SetupAuthS_None) in let Context_Seal_Some(ct_9: bitstring) = (let Context(key_7: key_t, nonce_7: nonce_t, seq_3: nonce_t) = ctx_7 in ct_8: bitstring <- (nonce_8: nonce_t <- xor(nonce_7, seq_3); Seal_inner(m, aad_8, key_7, nonce_8)); Context_Seal_Some(ct_8) else Context_Seal_None) in SealAuth_Some(enc_5, ct_9) else SealAuth_None else SealAuth_None) in
insert E(the_pk, pk_2, enc_6, ct_10, aad_8, info_5);
return(SealAuth_Some(enc_6, ct_10))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
return((let SetupAuthR_Some(ctx_9: context_t) = (let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in let KeySchedule_Some(ctx_8: context_t) = (let concat(key_8: key_t, nonce_9: nonce_t) = (r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6); concat(get1(r_4), get2(r_4))) in KeySchedule_Some(Context(key_8, nonce_9, nonce_zero)) else KeySchedule_None) in SetupAuthR_Some(ctx_8) else SetupAuthR_None else SetupAuthR_None) in OpenAuth_Some((let Context(key_9: key_t, nonce_10: nonce_t, seq_4: nonce_t) = ctx_9 in let injbot(pt_6: bitstring) = (nonce_11: nonce_t <- xor(nonce_10, seq_4); Open_inner(c, aad_9, key_9, nonce_11)) in Context_Open_Some(pt_6) else Context_Open_None else Context_Open_None)) else OpenAuth_None))
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_pk[i'], the_pk[i''], the_sk[i'], the_sk[i'']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
get E(=pk_S, =pk_R, =enc_star, =ciph_star, =aad_star, =info_star) in
return(bottom)
else
let OpenAuth_Some(Context_Open_Some(pt_8: bitstring)) = (skR_2: skey_t <- the_sk[i''_1]; let SetupAuthR_Some(ctx_11: context_t) = (let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skR_2, pk_S) in let KeySchedule_Some(ctx_10: context_t) = (let concat(key_10: key_t, nonce_12: nonce_t) = (r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star); concat(get1(r_5), get2(r_5))) in KeySchedule_Some(Context(key_10, nonce_12, nonce_zero)) else KeySchedule_None) in SetupAuthR_Some(ctx_10) else SetupAuthR_None else SetupAuthR_None) in OpenAuth_Some((let Context(key_11: key_t, nonce_13: nonce_t, seq_5: nonce_t) = ctx_11 in let injbot(pt_7: bitstring) = (nonce_14: nonce_t <- xor(nonce_13, seq_5); Open_inner(ciph_star, aad_star, key_11, nonce_14)) in Context_Open_Some(pt_7) else Context_Open_None else Context_Open_None)) else OpenAuth_None) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
))
Applying expand get, insert and prove unique annotations
- Expand get/insert for table E
yields
Game 2 is
((
foreach i <= N do
Osetup() :=
{5} let (the_sk: skey_t, the_pk: pkey_t) = (s <-R keypairseed_t; (skgen(s), pkgen(s))) in
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
{23} let SealAuth_Some(enc_6: kemciph_t, ct_10: bitstring) = {24}(let SetupAuthS_Some(enc_5: kemciph_t, ctx_7: context_t) = (let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = (pk_1: pkey_t <- pk_2; sk: skey_t <- the_sk; k <-R kemseed_t; AuthEncap_r(k, pk_1, sk)) in {44}let KeySchedule_Some(ctx_6: context_t) = {45}(let concat(key_6: key_t, nonce_6: nonce_t) = (r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5); concat(get1(r_3), get2(r_3))) in KeySchedule_Some(Context(key_6, nonce_6, nonce_zero)) else KeySchedule_None) in SetupAuthS_Some(enc_4, ctx_6) else SetupAuthS_None else SetupAuthS_None) in {82}let Context_Seal_Some(ct_9: bitstring) = {83}(let Context(key_7: key_t, nonce_7: nonce_t, seq_3: nonce_t) = ctx_7 in ct_8: bitstring <- (nonce_8: nonce_t <- xor(nonce_7, seq_3); Seal_inner(m, aad_8, key_7, nonce_8)); Context_Seal_Some(ct_8) else Context_Seal_None) in SealAuth_Some(enc_5, ct_9) else SealAuth_None else SealAuth_None) in
E_3: pkey_t <- the_pk;
E_4: pkey_t <- pk_2;
E_5: kemciph_t <- enc_6;
E_6: bitstring <- ct_10;
E_7: bitstring <- aad_8;
E_8: bitstring <- info_5;
return(SealAuth_Some(enc_6, ct_10))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
return({172}(let SetupAuthR_Some(ctx_9: context_t) = (let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in {183}let KeySchedule_Some(ctx_8: context_t) = {184}(let concat(key_8: key_t, nonce_9: nonce_t) = (r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6); concat(get1(r_4), get2(r_4))) in KeySchedule_Some(Context(key_8, nonce_9, nonce_zero)) else KeySchedule_None) in SetupAuthR_Some(ctx_8) else SetupAuthR_None else SetupAuthR_None) in OpenAuth_Some({219}(let Context(key_9: key_t, nonce_10: nonce_t, seq_4: nonce_t) = ctx_9 in let injbot(pt_6: bitstring) = (nonce_11: nonce_t <- xor(nonce_10, seq_4); Open_inner(c, aad_9, key_9, nonce_11)) in Context_Open_Some(pt_6) else Context_Open_None else Context_Open_None)) else OpenAuth_None))
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
{255} find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_pk[i'], the_pk[i''], the_sk[i'], the_sk[i'']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser, u_1 = u_3 <= N suchthat defined(E_3[u_2, u_3], E_4[u_2, u_3], E_5[u_2, u_3], E_6[u_2, u_3], E_7[u_2, u_3], E_8[u_2, u_3]) && (E_3[u_2, u_3] = pk_S) && (E_4[u_2, u_3] = pk_R) && (E_5[u_2, u_3] = enc_star) && (E_6[u_2, u_3] = ciph_star) && (E_7[u_2, u_3] = aad_star) && (E_8[u_2, u_3] = info_star) then
return(bottom)
else
{321} let OpenAuth_Some(Context_Open_Some(pt_8: bitstring)) = (skR_2: skey_t <- the_sk[i''_1]; {325}let SetupAuthR_Some(ctx_11: context_t) = (let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skR_2, pk_S) in {331}let KeySchedule_Some(ctx_10: context_t) = {332}(let concat(key_10: key_t, nonce_12: nonce_t) = (r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star); concat(get1(r_5), get2(r_5))) in KeySchedule_Some(Context(key_10, nonce_12, nonce_zero)) else KeySchedule_None) in SetupAuthR_Some(ctx_10) else SetupAuthR_None else SetupAuthR_None) in OpenAuth_Some({353}(let Context(key_11: key_t, nonce_13: nonce_t, seq_5: nonce_t) = ctx_11 in let injbot(pt_7: bitstring) = (nonce_14: nonce_t <- xor(nonce_13, seq_5); Open_inner(ciph_star, aad_star, key_11, nonce_14)) in Context_Open_Some(pt_7) else Context_Open_None else Context_Open_None)) else OpenAuth_None) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
))
Applying expand
- Expand if/find/let
- Remove let at 321
- Remove let at 325
- Remove let at 321
- Simplify pattern concat(key_10: key_t, nonce_12: nonce_t) (tuple expanded) at 332
- Remove else branch of let at 332
- Simplify pattern KeySchedule_Some(ctx_10: context_t) (tuple expanded) at 331
- Remove else branch of let at 331
- Simplify pattern SetupAuthR_Some(ctx_11: context_t) (tuple expanded) at 325
- Remove else branch of let at 325
- Simplify pattern Context(key_11: key_t, nonce_13: nonce_t, seq_5: nonce_t) (tuple expanded) at 353
- Remove else branch of let at 353
- Simplify pattern OpenAuth_Some(Context_Open_Some(pt_8: bitstring)) (tuple expanded) at 321
- Remove let at 321
- Simplify pattern Context_Open_Some(pt_8: bitstring) (tuple expanded), pattern OpenAuth_Some(Context_Open_Some(pt_8: bitstring)) (tuple expanded) at 321
- Remove else branch of let at 321
- Replaced defined condition the_pk[i'], the_pk[i''], the_sk[i'], the_sk[i''] with the_sk[i''], the_pk[i''], the_pk[i'] in find at 255
- Simplify pattern (the_sk: skey_t, the_pk: pkey_t) (tuple expanded) at 5
- Remove let at 172
- Simplify pattern concat(key_8: key_t, nonce_9: nonce_t) (tuple expanded) at 184
- Remove else branch of let at 184
- Simplify pattern KeySchedule_Some(ctx_8: context_t) (tuple expanded) at 183
- Remove else branch of let at 183
- Simplify pattern SetupAuthR_Some(ctx_9: context_t) (tuple expanded) at 172
- Remove else branch of let at 172
- Simplify pattern Context(key_9: key_t, nonce_10: nonce_t, seq_4: nonce_t) (tuple expanded) at 219
- Remove else branch of let at 219
- Remove let at 23
- Remove let at 24
- Remove let at 23
- Simplify pattern concat(key_6: key_t, nonce_6: nonce_t) (tuple expanded) at 45
- Remove else branch of let at 45
- Simplify pattern KeySchedule_Some(ctx_6: context_t) (tuple expanded) at 44
- Remove else branch of let at 44
- Simplify pattern SetupAuthS_Some(enc_5: kemciph_t, ctx_7: context_t) (tuple expanded) at 24
- Remove else branch of let at 24
- Simplify pattern Context(key_7: key_t, nonce_7: nonce_t, seq_3: nonce_t) (tuple expanded) at 83
- Remove else branch of let at 83
- Simplify pattern Context_Seal_Some(ct_9: bitstring) (tuple expanded) at 82
- Remove else branch of let at 82
- Simplify pattern SealAuth_Some(enc_6: kemciph_t, ct_10: bitstring) (tuple expanded) at 23
- Remove else branch of let at 23
yields
Game 3 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
pk_1: pkey_t <- pk_2;
sk: skey_t <- the_sk;
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_1, sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ctx_6: context_t <- Context(key_6, nonce_6, nonce_zero);
ctx_7: context_t <- ctx_6;
enc_5: kemciph_t <- enc_4;
seq_3: nonce_t <- nonce_zero;
nonce_7: nonce_t <- nonce_6;
key_7: key_t <- key_6;
nonce_8: nonce_t <- xor(nonce_7, seq_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_7, nonce_8);
ct_9: bitstring <- ct_8;
ct_10: bitstring <- ct_9;
enc_6: kemciph_t <- enc_5;
E_3: pkey_t <- the_pk;
E_4: pkey_t <- pk_2;
E_5: kemciph_t <- enc_6;
E_6: bitstring <- ct_10;
E_7: bitstring <- aad_8;
E_8: bitstring <- info_5;
return(SealAuth_Some(enc_6, ct_10))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
ctx_8: context_t <- Context(key_8, nonce_9, nonce_zero);
ctx_9: context_t <- ctx_8;
seq_4: nonce_t <- nonce_zero;
nonce_10: nonce_t <- nonce_9;
key_9: key_t <- key_8;
nonce_11: nonce_t <- xor(nonce_10, seq_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_9, nonce_11) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser, u_1 = u_3 <= N suchthat defined(E_3[u_2, u_3], E_4[u_2, u_3], E_5[u_2, u_3], E_6[u_2, u_3], E_7[u_2, u_3], E_8[u_2, u_3]) && (E_3[u_2, u_3] = pk_S) && (E_4[u_2, u_3] = pk_R) && (E_5[u_2, u_3] = enc_star) && (E_6[u_2, u_3] = ciph_star) && (E_7[u_2, u_3] = aad_star) && (E_8[u_2, u_3] = info_star) then
return(bottom)
else
skR_2: skey_t <- the_sk[i''_1];
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skR_2, pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
ctx_10: context_t <- Context(key_10, nonce_12, nonce_zero);
ctx_11: context_t <- ctx_10;
seq_5: nonce_t <- nonce_zero;
nonce_13: nonce_t <- nonce_12;
key_11: key_t <- key_10;
nonce_14: nonce_t <- xor(nonce_13, seq_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_11, nonce_14) in
pt_8: bitstring <- pt_7;
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying remove assignments of findcond
- Remove assignments on skR_2 (definition removed, all usages removed)
- Remove assignments on ctx_11 (definition removed, all usages removed)
- Remove assignments on nonce_13 (definition removed, all usages removed)
- Remove assignments on key_11 (definition removed, all usages removed)
- Remove assignments on pt_8 (definition removed, all usages removed)
- Remove assignments on ctx_9 (definition removed, all usages removed)
- Remove assignments on nonce_10 (definition removed, all usages removed)
- Remove assignments on key_9 (definition removed, all usages removed)
- Remove assignments on pk_1 (definition removed, all usages removed)
- Remove assignments on sk (definition removed, all usages removed)
- Remove assignments on ctx_7 (definition removed, all usages removed)
- Remove assignments on enc_5 (definition removed, all usages removed)
- Remove assignments on nonce_7 (definition removed, all usages removed)
- Remove assignments on key_7 (definition removed, all usages removed)
- Remove assignments on ct_9 (definition removed, all usages removed)
- Remove assignments on ct_10 (definition removed, all usages removed)
- Remove assignments on enc_6 (definition removed, all usages removed)
- Remove assignments on E_3 (definition removed, all usages removed)
- Remove assignments on E_4 (definition removed, all usages removed)
- Remove assignments on E_5 (definition removed, all usages removed)
- Remove assignments on E_6 (definition removed, all usages removed)
- Remove assignments on E_7 (definition removed, all usages removed)
- Remove assignments on E_8 (definition removed, all usages removed)
- Remove assignments on ctx_10 (definition removed, all usages removed)
- Remove assignments on ctx_8 (definition removed, all usages removed)
- Remove assignments on ctx_6 (definition removed, all usages removed)
yields
Game 4 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, the_sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
seq_3: nonce_t <- nonce_zero;
nonce_8: nonce_t <- {55}xor(nonce_6, seq_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_8);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
seq_4: nonce_t <- nonce_zero;
nonce_11: nonce_t <- {131}xor(nonce_9, seq_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_11) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
{190} find u = u_2 <= Qeperuser, u_1 = u_3 <= N suchthat defined(the_pk[u_3], pk_2[u_2, u_3], enc_4[u_2, u_3], aad_8[u_2, u_3], info_5[u_2, u_3], ct_8[u_2, u_3]) && {202}((the_pk[u_3] = pk_S) && (pk_2[u_2, u_3] = pk_R) && (enc_4[u_2, u_3] = enc_star) && (ct_8[u_2, u_3] = ciph_star) && (aad_8[u_2, u_3] = aad_star) && (info_5[u_2, u_3] = info_star)) then
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, the_sk[i''_1], pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
seq_5: nonce_t <- nonce_zero;
nonce_14: nonce_t <- {259}xor(nonce_12, seq_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_14) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying simplify [probability N^2 * P_pk_coll]
- Simplification pass
- Replaced xor(nonce_12, seq_5) with nonce_12 at 259
- Replaced ((the_pk[u_3] = pk_S) && (pk_2[u_2, u_3] = pk_R) && (enc_4[u_2, u_3] = enc_star) && (ct_8[u_2, u_3] = ciph_star) && (aad_8[u_2, u_3] = aad_star) && (info_5[u_2, u_3] = info_star)) with ((u_3 = i'_1) && (pk_2[u_2, u_3] = pk_R) && (enc_4[u_2, u_3] = enc_star) && (ct_8[u_2, u_3] = ciph_star) && (aad_8[u_2, u_3] = aad_star) && (info_5[u_2, u_3] = info_star)) at 202
- In branch 1 of find at 190, substituting u_1 with i'_1
- Replaced defined condition the_pk[u_3], pk_2[u_2, u_3], enc_4[u_2, u_3], aad_8[u_2, u_3], info_5[u_2, u_3], ct_8[u_2, u_3] with info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1] in find at 190
- Replaced xor(nonce_9, seq_4) with nonce_9 at 131
- Replaced xor(nonce_6, seq_3) with nonce_6 at 55
yields
Game 5 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, the_sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
seq_3: nonce_t <- nonce_zero;
nonce_8: nonce_t <- nonce_6;
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_8);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
seq_4: nonce_t <- nonce_zero;
nonce_11: nonce_t <- nonce_9;
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_11) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && {193}((i'_1 = i'_1) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star)) then
u_1 <= N <- i'_1;
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, the_sk[i''_1], pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
seq_5: nonce_t <- nonce_zero;
nonce_14: nonce_t <- nonce_12;
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_14) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying simplify
- Simplification pass
- Replaced ((i'_1 = i'_1) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star)) with ((pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star)) at 193
yields
Game 6 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, the_sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
seq_3: nonce_t <- nonce_zero;
nonce_8: nonce_t <- nonce_6;
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_8);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
seq_4: nonce_t <- nonce_zero;
nonce_11: nonce_t <- nonce_9;
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_11) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
u_1 <= N <- i'_1;
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, the_sk[i''_1], pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
seq_5: nonce_t <- nonce_zero;
nonce_14: nonce_t <- nonce_12;
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_14) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying move all binders
- Move assignment to seq_5
- Move assignment to seq_4
yields
Game 7 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, the_sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
seq_3: nonce_t <- nonce_zero;
nonce_8: nonce_t <- nonce_6;
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_8);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
nonce_11: nonce_t <- nonce_9;
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_11) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
u_1 <= N <- i'_1;
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, the_sk[i''_1], pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
nonce_14: nonce_t <- nonce_12;
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_14) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying remove assignments of findcond
- Remove assignments on nonce_14 (definition removed, all usages removed)
- Remove assignments on u_1 (definition removed, all usages removed)
- Remove assignments on nonce_11 (definition removed, all usages removed)
- Remove assignments on seq_3 (definition removed, all usages removed)
- Remove assignments on nonce_8 (definition removed, all usages removed)
yields
Game 8 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
the_sk: skey_t <- skgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, the_sk) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, the_sk, pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(the_sk[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, the_sk[i''_1], pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying remove assignments of binder the_sk
- Remove assignments on the_sk (definition removed, all usages removed)
yields
Game 9 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
the_pk: pkey_t <- pkgen(s);
return(the_pk);
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, skgen(s), pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(s[i''], the_pk[i''], the_pk[i']) && (the_pk[i'] = pk_S) && (the_pk[i''] = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skgen(s[i''_1]), pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying remove assignments of binder the_pk
- Remove assignments on the_pk (definition removed, all usages removed)
yields
Game 10 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
return(pkgen(s));
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, skgen(s), pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(s[i'], s[i'']) && (pkgen(s[i']) = pk_S) && (pkgen(s[i'']) = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skgen(s[i''_1]), pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying equivalence outsider_cca(AuthEncap) with variables: s -> s_1 [probability Adv_Outsider_CCA(time_1, N, #Oaenc, 1 + #Oadec)]
- Equivalence outsider_cca(AuthEncap) with variables: k -> ks, s -> s_1
yields
Game 11 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
return(pkgen(s));
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
k'_1 <-R kemkey_t;
{18} let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = (pk_R_1: pkey_t <- pk_2; find u_8 = ri_4 <= N suchthat defined(s[ri_4]) && (pk_R_1 = pkgen(s[ri_4])) then let AuthEncap_tuple(k_1: kemkey_t, ce: kemciph_t) = AuthEncap_r(k, pk_R_1, skgen(s)) in k': kemkey_t <- cst_kemkey_t; E_9: pkey_t <- pkgen(s); AuthEncap_tuple(k'_1, ce) else AuthEncap_None else AuthEncap_r(k, pk_R_1, skgen(s))) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
{121} let AuthDecap_Some(shared_secret_4: kemkey_t) = (pk_S_1: pkey_t <- pk_3; cd: kemciph_t <- enc_7; find u_6 = ri_2 <= Qeperuser, u_7 = ri_3 <= N suchthat defined(k'_1[ri_2, ri_3], ce[ri_2, ri_3], pk_R_1[ri_2, ri_3], E_9[ri_2, ri_3]) && (E_9[ri_2, ri_3] = pk_S_1) && (pk_R_1[ri_2, ri_3] = pkgen(s)) && (ce[ri_2, ri_3] = cd) then AuthDecap_Some(k'_1[u_6, u_7]) else AuthDecap(cd, skgen(s), pk_S_1)) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(s[i'], s[i'']) && (pkgen(s[i']) = pk_S) && (pkgen(s[i'']) = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
{291} let AuthDecap_Some(shared_secret_5: kemkey_t) = (pk_S_2: pkey_t <- pk_S; cd_1: kemciph_t <- enc_star; find u_4 = ri <= Qeperuser, u_5 = ri_1 <= N suchthat defined(k'_1[ri, ri_1], ce[ri, ri_1], pk_R_1[ri, ri_1], E_9[ri, ri_1]) && (E_9[ri, ri_1] = pk_S_2) && (pk_R_1[ri, ri_1] = pkgen(s[i''_1])) && (ce[ri, ri_1] = cd_1) then AuthDecap_Some(k'_1[u_4, u_5]) else AuthDecap(cd_1, skgen(s[i''_1]), pk_S_2)) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying expand [probability N^2 * P_pk_coll]
- Expand if/find/let
- Simplify pattern AuthDecap_Some(shared_secret_5: kemkey_t) (tuple expanded) at 291
- Remove else branch of let at 291
- Simplify pattern AuthDecap_Some(shared_secret_4: kemkey_t) (tuple expanded) at 121
- Remove else branch of let at 121
- Simplify pattern AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) (tuple expanded) at 18
- Remove else branch of let at 18
yields
Game 12 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
return(pkgen(s));
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
k'_1 <-R kemkey_t;
pk_R_1: pkey_t <- pk_2;
find u_8 = ri_4 <= N suchthat defined(s[ri_4]) && (pk_R_1 = pkgen(s[ri_4])) then
let AuthEncap_tuple(k_1: kemkey_t, ce: kemciph_t) = AuthEncap_r(k, pk_R_1, skgen(s)) in
k': kemkey_t <- cst_kemkey_t;
E_9: pkey_t <- pkgen(s);
enc_4: kemciph_t <- ce;
shared_secret_3: kemkey_t <- k'_1;
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_None in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_R_1, skgen(s)) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
pk_S_1: pkey_t <- pk_3;
cd: kemciph_t <- enc_7;
find u_6 = ri_2 <= Qeperuser, u_7 = ri_3 <= N suchthat defined(k'_1[ri_2, ri_3], ce[ri_2, ri_3], pk_R_1[ri_2, ri_3], E_9[ri_2, ri_3]) && (E_9[ri_2, ri_3] = pk_S_1) && (pk_R_1[ri_2, ri_3] = pkgen(s)) && (ce[ri_2, ri_3] = cd) then
shared_secret_4: kemkey_t <- k'_1[u_6, u_7];
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(cd, skgen(s), pk_S_1) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(s[i'], s[i'']) && (pkgen(s[i']) = pk_S) && (pkgen(s[i'']) = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
pk_S_2: pkey_t <- pk_S;
cd_1: kemciph_t <- enc_star;
find u_4 = ri <= Qeperuser, u_5 = ri_1 <= N suchthat defined(k'_1[ri, ri_1], ce[ri, ri_1], pk_R_1[ri, ri_1], E_9[ri, ri_1]) && (E_9[ri, ri_1] = pk_S_2) && (pk_R_1[ri, ri_1] = pkgen(s[i''_1])) && (ce[ri, ri_1] = cd_1) then
shared_secret_5: kemkey_t <- k'_1[u_4, u_5];
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(cd_1, skgen(s[i''_1]), pk_S_2) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying remove assignments of findcond
- Remove assignments on pk_S_2 (definition removed, all usages removed)
- Remove assignments on cd_1 (definition removed, all usages removed)
- Remove assignments on shared_secret_5 (definition removed, all usages removed)
- Remove assignments on pk_S_1 (definition removed, all usages removed)
- Remove assignments on cd (definition removed, all usages removed)
- Remove assignments on shared_secret_4 (definition removed, all usages removed)
- Remove assignments on pk_R_1 (definition removed, all usages removed)
- Remove assignments on k' (definition removed, all usages removed)
- Remove assignments on shared_secret_3 (definition removed, all usages removed)
- Remove assignments on enc_4 (definition kept, array references kept)
yields
Game 13 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
return(pkgen(s));
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
k'_1 <-R kemkey_t;
find u_8 = ri_4 <= N suchthat defined(s[ri_4]) && (pk_2 = pkgen(s[ri_4])) then
let AuthEncap_tuple(k_1: kemkey_t, ce: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
E_9: pkey_t <- pkgen(s);
enc_4: kemciph_t <- ce;
r_3: keys_t <- KeySchedule_auth(k'_1, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(ce, ct_8))
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_None in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
) | (
foreach iad <= Qdperuser do
Oadec(pk_3: pkey_t, enc_7: kemciph_t, c: bitstring, aad_9: bitstring, info_6: bitstring) :=
{211} find u_6 = ri_2 <= Qeperuser, u_7 = ri_3 <= N suchthat defined(pk_2[ri_2, ri_3], k'_1[ri_2, ri_3], ce[ri_2, ri_3], E_9[ri_2, ri_3]) && {220}((E_9[ri_2, ri_3] = pk_3) && (pk_2[ri_2, ri_3] = pkgen(s)) && (ce[ri_2, ri_3] = enc_7)) then
r_4: keys_t <- KeySchedule_auth(k'_1[u_6, u_7], info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
let AuthDecap_Some(shared_secret_4: kemkey_t) = AuthDecap(enc_7, skgen(s), pk_3) in
r_4: keys_t <- KeySchedule_auth(shared_secret_4, info_6);
nonce_9: nonce_t <- get2(r_4);
key_8: key_t <- get1(r_4);
let injbot(pt_6: bitstring) = Open_inner(c, aad_9, key_8, nonce_9) in
return(OpenAuth_Some(Context_Open_Some(pt_6)))
else
return(OpenAuth_Some(Context_Open_None))
else
return(OpenAuth_None)
))
) | (
Ochall(pk_S: pkey_t, pk_R: pkey_t, enc_star: kemciph_t, ciph_star: bitstring, aad_star: bitstring, info_star: bitstring) :=
find i'_1 = i' <= N, i''_1 = i'' <= N suchthat defined(s[i'], s[i'']) && (pkgen(s[i']) = pk_S) && (pkgen(s[i'']) = pk_R) then
find u = u_2 <= Qeperuser suchthat defined(info_5[u_2, i'_1], aad_8[u_2, i'_1], ct_8[u_2, i'_1], enc_4[u_2, i'_1], pk_2[u_2, i'_1]) && (pk_2[u_2, i'_1] = pk_R) && (enc_4[u_2, i'_1] = enc_star) && (ct_8[u_2, i'_1] = ciph_star) && (aad_8[u_2, i'_1] = aad_star) && (info_5[u_2, i'_1] = info_star) then
return(bottom)
else
{417} find u_4 = ri <= Qeperuser, u_5 = ri_1 <= N suchthat defined(pk_2[ri, ri_1], k'_1[ri, ri_1], ce[ri, ri_1], E_9[ri, ri_1]) && {426}((E_9[ri, ri_1] = pk_S) && (pk_2[ri, ri_1] = pkgen(s[i''_1])) && (ce[ri, ri_1] = enc_star)) then
r_5: keys_t <- KeySchedule_auth(k'_1[u_4, u_5], info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
let AuthDecap_Some(shared_secret_5: kemkey_t) = AuthDecap(enc_star, skgen(s[i''_1]), pk_S) in
r_5: keys_t <- KeySchedule_auth(shared_secret_5, info_star);
nonce_12: nonce_t <- get2(r_5);
key_10: key_t <- get1(r_5);
let injbot(pt_7: bitstring) = Open_inner(ciph_star, aad_star, key_10, nonce_12) in
event_abort adv_wins
else
return(bottom)
else
return(bottom)
else
return(bottom)
))
Applying simplify [probability N^2 * P_pk_coll]
- Simplification pass
- Replaced ((E_9[ri, ri_1] = pk_S) && (pk_2[ri, ri_1] = pkgen(s[i''_1])) && (ce[ri, ri_1] = enc_star)) with ((ri_1 = i'_1) && (u_8[ri, ri_1] = i''_1) && (ce[ri, ri_1] = enc_star)) at 426
- In branch 1 of find at 417, substituting u_5 with i'_1
- Replaced defined condition pk_2[ri, ri_1], k'_1[ri, ri_1], ce[ri, ri_1], E_9[ri, ri_1] with E_9[ri, i'_1], k'_1[ri, i'_1], ce[ri, i'_1], u_8[ri, i'_1] in find at 417
- Replaced ((E_9[ri_2, ri_3] = pk_3) && (pk_2[ri_2, ri_3] = pkgen(s)) && (ce[ri_2, ri_3] = enc_7)) with ((E_9[ri_2, ri_3] = pk_3) && (u_8[ri_2, ri_3] = i) && (ce[ri_2, ri_3] = enc_7)) at 220
- Replaced defined condition pk_2[ri_2, ri_3], k'_1[ri_2, ri_3], ce[ri_2, ri_3], E_9[ri_2, ri_3] with k'_1[ri_2, ri_3], ce[ri_2, ri_3], u_8[ri_2, ri_3], E_9[ri_2, ri_3] in find at 211
yields
Game 14 is
((
foreach i <= N do
Osetup() :=
s <-R keypairseed_t;
return(pkgen(s));
((
foreach iae <= Qeperuser do
Oaenc(pk_2: pkey_t, m: bitstring, aad_8: bitstring, info_5: bitstring) :=
k <-R kemseed_t;
k'_1 <-R kemkey_t;
find u_8 = ri_4 <= N suchthat defined(s[ri_4]) && (pk_2 = pkgen(s[ri_4])) then
let AuthEncap_tuple(k_1: kemkey_t, ce: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
E_9: pkey_t <- pkgen(s);
enc_4: kemciph_t <- ce;
r_3: keys_t <- KeySchedule_auth(k'_1, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(ce, ct_8))
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_None in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else
return(SealAuth_None)
else
let AuthEncap_tuple(shared_secret_3: kemkey_t, enc_4: kemciph_t) = AuthEncap_r(k, pk_2, skgen(s)) in
r_3: keys_t <- KeySchedule_auth(shared_secret_3, info_5);
nonce_6: nonce_t <- get2(r_3);
key_6: key_t <- get1(r_3);
ct_8: bitstring <- Seal_inner(m, aad_8, key_6, nonce_6);
return(SealAuth_Some(enc_4, ct_8))
else