file_name
stringlengths
5
52
name
stringlengths
4
95
original_source_type
stringlengths
0
23k
source_type
stringlengths
9
23k
source_definition
stringlengths
9
57.9k
source
dict
source_range
dict
file_context
stringlengths
0
721k
dependencies
dict
opens_and_abbrevs
listlengths
2
94
vconfig
dict
interleaved
bool
1 class
verbose_type
stringlengths
1
7.42k
effect
stringclasses
118 values
effect_flags
sequencelengths
0
2
mutual_with
sequencelengths
0
11
ideal_premises
sequencelengths
0
236
proof_features
sequencelengths
0
1
is_simple_lemma
bool
2 classes
is_div
bool
2 classes
is_proof
bool
2 classes
is_simply_typed
bool
2 classes
is_type
bool
2 classes
partial_definition
stringlengths
5
3.99k
completed_definiton
stringlengths
1
1.63M
isa_cross_project_example
bool
1 class
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fsub
val va_codegen_success_Fsub : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Fsub : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 12, "end_line": 2478, "start_col": 0, "start_line": 2474 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsMem.va_codegen_success_CreateHeaplets", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fast_sub", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Carry_sub_pass", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Store4", "Vale.X64.InsMem.va_codegen_success_DestroyHeaplets", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Fsub () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fast_mul1
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))
val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))
let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 262, "start_col": 0, "start_line": 233 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> offset: Prims.nat -> inA_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.nat", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Vale.X64.Decls.va_mul_nat", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Prims.op_LessThan", "Prims.op_Subtraction", "Vale.X64.Machine_s.pow2_64", "Prims.int", "Vale.Curve25519.Fast_defs.pow2_five", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Prims.op_Addition", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_mul1" ]
[]
false
false
false
false
false
let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok ] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_add
val va_qcode_Fast_add (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ()))
val va_qcode_Fast_add (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ()))
let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (()))))))))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 74, "end_line": 1794, "start_col": 0, "start_line": 1743 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ())))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fast_add ())
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsMem.va_code_Load64_buffer", "Vale.X64.Decls.va_op_heaplet_mem_heaplet", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdx", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.InsMem.va_code_Mem64_lemma", "Vale.X64.InsBasic.va_code_Add64Wrap", "Vale.X64.Decls.va_opr_code_Mem64", "Vale.X64.Decls.va_op_reg64_reg64", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rR9", "Vale.X64.InsBasic.va_code_Adcx64Wrap", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR11", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Vale.Def.Words_s.nat32", "Prims.eq2", "Vale.Def.Types_s.ixor", "Prims.int", "Vale.Def.Words_s.nat64", "Vale.X64.QuickCodes.va_range1", "Vale.Arch.Types.xor_lemmas", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.InsMem.va_quick_Load64_buffer", "Vale.X64.InsMem.va_quick_Mem64_lemma", "Vale.X64.InsBasic.va_quick_Add64Wrap", "Vale.X64.InsBasic.va_quick_Adcx64Wrap", "Vale.X64.QuickCodes.va_QEmpty", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.quickCodes", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_add" ]
[]
false
false
false
false
false
let va_qcode_Fast_add (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_add ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (()))))))))))))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fsub_stdcall
val va_codegen_success_Fsub_stdcall : win:bool -> Tot va_pbool
val va_codegen_success_Fsub_stdcall : win:bool -> Tot va_pbool
let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ()))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 33, "end_line": 2586, "start_col": 0, "start_line": 2577 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ())))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.bool", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsStack.va_codegen_success_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fsub", "Vale.X64.InsStack.va_codegen_success_Pop_Secret" ]
[]
false
false
false
true
false
let va_codegen_success_Fsub_stdcall win =
(va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ()))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_code_Fsub_stdcall
val va_code_Fsub_stdcall : win:bool -> Tot va_code
val va_code_Fsub_stdcall : win:bool -> Tot va_code
let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ())))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 63, "end_line": 2574, "start_col": 0, "start_line": 2566 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.bool", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsStack.va_code_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub", "Vale.X64.InsStack.va_code_Pop_Secret" ]
[]
false
false
false
true
false
let va_code_Fsub_stdcall win =
(va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx) ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ())))))
false
UnionFind.Functions.fst
UnionFind.Functions.subtree
val subtree (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot subtree_t
val subtree (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot subtree_t
let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i)))
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 123, "end_line": 31, "start_col": 7, "start_line": 31 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i))
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i: UnionFind.Forest.id n -> h: FStar.DM4F.Heap.heap -> Prims.GTot UnionFind.Forest.subtree_t
Prims.GTot
[ "sometrivial" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.DM4F.Heap.heap", "FStar.Ghost.reveal", "UnionFind.Forest.subtree_t", "FStar.Pervasives.Native.__proj__Mktuple3__item___3", "FStar.Ghost.erased", "FStar.DM4F.Heap.sel", "UnionFind.Forest.elt", "FStar.Seq.Base.index", "FStar.DM4F.Heap.ref" ]
[]
false
false
false
false
false
let subtree (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot subtree_t =
reveal (Mktuple3?._3 (sel h (index uf i)))
false
UnionFind.Functions.fst
UnionFind.Functions.parent
val parent (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot (id n)
val parent (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot (id n)
let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i))
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 114, "end_line": 29, "start_col": 7, "start_line": 29 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i: UnionFind.Forest.id n -> h: FStar.DM4F.Heap.heap -> Prims.GTot (UnionFind.Forest.id n)
Prims.GTot
[ "sometrivial" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.DM4F.Heap.heap", "FStar.Pervasives.Native.__proj__Mktuple3__item___1", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "FStar.DM4F.Heap.sel", "UnionFind.Forest.elt", "FStar.Seq.Base.index", "FStar.DM4F.Heap.ref" ]
[]
false
false
false
false
false
let parent (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot (id n) =
Mktuple3?._1 (sel h (index uf i))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_quick_Fast_sub
val va_quick_Fast_sub (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ()))
val va_quick_Fast_sub (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ()))
let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 11, "end_line": 2175, "start_col": 0, "start_line": 2171 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub ())
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.Memory.buffer64", "Vale.X64.QuickCode.va_QProc", "Prims.unit", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Prims.Nil", "Vale.Curve25519.X64.FastHybrid.va_wp_Fast_sub", "Vale.Curve25519.X64.FastHybrid.va_wpProof_Fast_sub", "Vale.X64.QuickCode.va_quickCode" ]
[]
false
false
false
false
false
let va_quick_Fast_sub (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ())) =
(va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fast_mul1_add
val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))))
val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))))
let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 806, "start_col": 0, "start_line": 773 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> offset: Prims.nat -> inA_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.nat", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rRcx", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1_add", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Addition", "Vale.X64.Decls.va_mul_nat", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Vale.Curve25519.Fast_defs.pow2_five", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_mul1_add" ]
[]
false
false
false
false
false
let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok ] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let a4:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let a5:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let a6:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let a7:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let a':Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_code_Fmul1
val va_code_Fmul1 : va_dummy:unit -> Tot va_code
val va_code_Fmul1 : va_dummy:unit -> Tot va_code
let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 92, "end_line": 2743, "start_col": 0, "start_line": 2736 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600"
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsMem.va_code_CreateHeaplets", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1", "Vale.X64.InsBasic.va_code_LargeComment", "Vale.X64.InsBasic.va_code_Comment", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Decls.va_const_opr64", "Vale.Curve25519.X64.FastHybrid.va_code_Carry_pass", "Vale.X64.InsMem.va_code_DestroyHeaplets", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code" ]
[]
false
false
false
true
false
let va_code_Fmul1 () =
(va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field") (va_CCons (va_code_Comment "Step 1: Compute carry*38") (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fsub
val va_qcode_Fsub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub ()))
val va_qcode_Fsub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub ()))
let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 56, "end_line": 2504, "start_col": 0, "start_line": 2481 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fsub ())
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsMem.va_code_CreateHeaplets", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub", "Vale.Curve25519.X64.FastHybrid.va_code_Carry_sub_pass", "Vale.Curve25519.X64.FastHybrid.va_code_Store4", "Vale.X64.InsMem.va_code_DestroyHeaplets", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsMem.va_quick_CreateHeaplets", "Vale.Arch.HeapImpl.buffer_info", "Vale.X64.InsMem.declare_buffer64", "Vale.Arch.HeapTypes_s.Secret", "Vale.Arch.HeapImpl.Immutable", "Vale.Arch.HeapImpl.Mutable", "Vale.Curve25519.X64.FastHybrid.va_quick_Fast_sub", "Vale.Curve25519.X64.FastHybrid.va_quick_Carry_sub_pass", "Vale.Curve25519.X64.FastHybrid.va_quick_Store4", "Vale.X64.InsMem.va_quick_DestroyHeaplets", "Vale.X64.QuickCodes.va_QEmpty", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.quickCodes", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub" ]
[]
false
false
false
false
false
let va_qcode_Fsub (va_mods: va_mods_t) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([ declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable ])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_sub
val va_qcode_Fast_sub (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ()))
val va_qcode_Fast_sub (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ()))
let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (()))))))))))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 82, "end_line": 2042, "start_col": 0, "start_line": 1979 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ()))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub ())
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsBasic.va_code_Comment", "Vale.X64.InsMem.va_code_Load64_buffer", "Vale.X64.Decls.va_op_heaplet_mem_heaplet", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRsi", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.InsMem.va_code_Mem64_lemma", "Vale.X64.InsBasic.va_code_Sub64Wrap", "Vale.X64.Decls.va_opr_code_Mem64", "Vale.X64.Decls.va_op_reg64_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR9", "Vale.X64.InsBasic.va_code_Sbb64", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR11", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsBasic.va_quick_Comment", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Vale.Def.Words_s.nat32", "Prims.eq2", "Vale.Def.Types_s.ixor", "Prims.int", "Vale.Def.Words_s.nat64", "Vale.Arch.Types.xor_lemmas", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.InsMem.va_quick_Load64_buffer", "Vale.X64.InsMem.va_quick_Mem64_lemma", "Vale.X64.InsBasic.va_quick_Sub64Wrap", "Vale.X64.InsBasic.va_quick_Sbb64", "Prims.b2t", "Prims.op_Equality", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Curve25519.FastUtil_helpers.sub_carry", "Vale.Curve25519.Fast_defs.bit", "Prims.logical", "Prims.op_Subtraction", "Prims.op_Multiply", "Vale.Curve25519.FastUtil_helpers.lemma_sub", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.Decls.va_get_reg64", "Vale.Curve25519.Fast_defs.bool_bit", "Vale.X64.Decls.cf", "Vale.X64.Decls.va_get_flags", "Vale.X64.QuickCodes.quickCodes", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub" ]
[]
false
false
false
false
false
let va_qcode_Fast_sub (va_mods: va_mods_t) (inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fast_sub ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2") (fun (va_s: va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s: va_state) _ -> let va_arg37:Vale.Curve25519.Fast_defs.bit = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let va_arg36:Vale.Def.Types_s.nat64 = va_get_reg64 rR11 va_s in let va_arg35:Vale.Def.Types_s.nat64 = va_get_reg64 rR10 va_s in let va_arg34:Vale.Def.Types_s.nat64 = va_get_reg64 rR9 va_s in let va_arg33:Vale.Def.Types_s.nat64 = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))) ))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_mul1_add
val va_qcode_Fast_mul1_add (va_mods: va_mods_t) (offset: nat) (inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset))
val va_qcode_Fast_mul1_add (va_mods: va_mods_t) (offset: nat) (inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset))
let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (())))))))))))))))))))))))))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 40, "end_line": 731, "start_col": 0, "start_line": 594 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> offset: Prims.nat -> inA_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1_add offset)
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Prims.nat", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsMem.va_code_Mem64_lemma", "Vale.X64.InsBasic.va_code_Mulx64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_opr_code_Mem64", "Vale.X64.Decls.va_op_heaplet_mem_heaplet", "Vale.X64.Decls.va_op_reg64_reg64", "Vale.X64.Machine_s.rRsi", "Prims.op_Addition", "Prims.op_Multiply", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.InsBasic.va_code_Xor64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.InsBasic.va_code_Adox64Wrap", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rR9", "Vale.X64.InsBasic.va_code_Adcx64Wrap", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rRax", "Vale.X64.Machine_s.rR11", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.l_True", "Prims.l_Forall", "Prims.l_imp", "Vale.Def.Words_s.nat32", "Prims.eq2", "Vale.Def.Types_s.ixor", "Prims.int", "Vale.Def.Words_s.nat64", "Vale.X64.QuickCodes.va_range1", "Vale.Arch.Types.xor_lemmas", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.InsMem.va_quick_Mem64_lemma", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.InsBasic.va_quick_Mulx64", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Subtraction", "Prims.l_or", "Prims.op_LessThanOrEqual", "Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds", "Vale.X64.InsBasic.va_quick_Xor64", "Vale.X64.InsBasic.va_quick_Adox64Wrap", "Vale.X64.InsBasic.va_quick_Adcx64Wrap", "Vale.X64.QuickCodes.va_qAssert", "Prims.op_Equality", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Curve25519.Fast_defs.add_carry", "Prims.op_BarBar", "Prims.logical", "Vale.Curve25519.Fast_defs.pow2_five", "Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1", "Vale.Curve25519.FastHybrid_helpers.lemma_addition", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdx", "Vale.Curve25519.Fast_defs.bit", "Vale.Curve25519.Fast_defs.bool_bit", "Vale.X64.Decls.cf", "Vale.X64.Decls.va_get_flags", "Vale.X64.QuickCodes.quickCodes", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1_add" ]
[]
false
false
false
false
false
let va_qcode_Fast_mul1_add (va_mods: va_mods_t) (offset: nat) (inA_b: buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let a4:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let a5:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let a6:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let a7:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let a':Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s: va_state) _ -> let va_arg100:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_s in let va_arg99:Vale.Def.Types_s.nat64 = va_get_reg64 rR8 va_s in let va_arg98:Vale.Def.Types_s.nat64 = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let ba4_hi:nat64 = va_get_reg64 rR13 va_s in let ba4_lo:nat64 = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s: va_state) _ -> let va_arg97:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_s in let va_arg96:Vale.Def.Types_s.nat64 = va_get_reg64 rR9 va_s in let va_arg95:Vale.Def.Types_s.nat64 = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let ba5_hi:nat64 = va_get_reg64 rRbx va_s in let ba5_lo:nat64 = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9 ) (va_op_opr64_reg64 rR13)) (fun (va_s: va_state) _ -> let s1:nat64 = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8 ) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10 ) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi ) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s: va_state) _ -> let va_arg94:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_s in let va_arg93:Vale.Def.Types_s.nat64 = va_get_reg64 rR10 va_s in let va_arg92:Vale.Def.Types_s.nat64 = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let ba6_hi:nat64 = va_get_reg64 rR13 va_s in let ba6_lo:nat64 = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s: va_state) _ -> let s2:nat64 = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi ) (16 + offset `op_Multiply` 8) inA_b (2 + offset ) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10 ) (va_opr_code_Mem64 ( va_op_heaplet_mem_heaplet 0 ) ( va_op_reg64_reg64 rRsi ) ( 16 + offset `op_Multiply` 8 ) Secret )) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma ( va_op_heaplet_mem_heaplet 0 ) ( va_op_reg64_reg64 rRsi ) ( 56 + offset `op_Multiply` 8 ) inA_b ( 7 + offset ) Secret ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Mulx64 ( va_op_dst_opr64_reg64 rRax ) ( va_op_dst_opr64_reg64 rR11 ) ( va_opr_code_Mem64 ( va_op_heaplet_mem_heaplet 0 ) ( va_op_reg64_reg64 rRsi ) ( 56 + offset `op_Multiply` 8 ) Secret ) ) ( fun ( va_s: va_state ) _ -> let va_arg91:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_s in let va_arg90:Vale.Def.Types_s.nat64 = va_get_reg64 rR11 va_s in let va_arg89:Vale.Def.Types_s.nat64 = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( fun ( _: unit ) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7 ) ( let ba7_hi:nat64 = va_get_reg64 rRax va_s in let ba7_lo:nat64 = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Adcx64Wrap ( va_op_dst_opr64_reg64 rR11 ) ( va_op_opr64_reg64 rR13 ) ) ( fun ( va_s: va_state ) _ -> let s3:nat64 = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Mem64_lemma ( va_op_heaplet_mem_heaplet 0 ) ( va_op_reg64_reg64 rRsi ) ( 24 + offset `op_Multiply` 8 ) inA_b ( 3 + offset ) Secret ) ( va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Adox64Wrap ( va_op_dst_opr64_reg64 rR11 ) ( va_opr_code_Mem64 ( va_op_heaplet_mem_heaplet 0 ) ( va_op_reg64_reg64 rRsi ) ( 24 + offset `op_Multiply` 8 ) Secret ) ) ( va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Adcx64Wrap ( va_op_dst_opr64_reg64 rRax ) ( va_op_opr64_reg64 rRcx ) ) ( fun ( va_s: va_state ) _ -> let s4:nat64 = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( va_quick_Adox64Wrap ( va_op_dst_opr64_reg64 rRax ) ( va_op_opr64_reg64 rRcx ) ) ( fun ( va_s: va_state ) _ -> let carry_bit:Vale.Curve25519.Fast_defs.bit = Vale.Curve25519.Fast_defs.bool_bit ( Vale.X64.Decls.cf ( va_get_flags va_s ) ) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( carry_bit == 0 ) ( let va_arg88:Vale.Def.Types_s.nat64 = s4 in let va_arg87:Vale.Def.Types_s.nat64 = s3 in let va_arg86:Vale.Def.Types_s.nat64 = s2 in let va_arg85:Vale.Def.Types_s.nat64 = s1 in let va_arg84:Vale.Def.Types_s.nat64 = ba7_lo in let va_arg83:Vale.Def.Types_s.nat64 = ba7_hi in let va_arg82:Vale.Def.Types_s.nat64 = ba6_lo in let va_arg81:Vale.Def.Types_s.nat64 = ba6_hi in let va_arg80:Vale.Def.Types_s.nat64 = ba5_lo in let va_arg79:Vale.Def.Types_s.nat64 = ba5_hi in let va_arg78:Vale.Def.Types_s.nat64 = ba4_lo in let va_arg77:Vale.Def.Types_s.nat64 = ba4_hi in let va_arg76:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( fun ( _: unit ) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88 ) ( let d:Prims.nat = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let va_arg75:Vale.Def.Types_s.nat64 = va_get_reg64 rRax va_s in let va_arg74:Vale.Def.Types_s.nat64 = va_get_reg64 rR11 va_s in let va_arg73:Vale.Def.Types_s.nat64 = va_get_reg64 rR10 va_s in let va_arg72:Vale.Def.Types_s.nat64 = va_get_reg64 rR9 va_s in let va_arg71:Vale.Def.Types_s.nat64 = va_get_reg64 rR8 va_s in let va_arg70:Vale.Def.Types_s.nat64 = s4 in let va_arg69:Vale.Def.Types_s.nat64 = s3 in let va_arg68:Vale.Def.Types_s.nat64 = s2 in let va_arg67:Vale.Def.Types_s.nat64 = s1 in let va_arg66:Vale.Def.Types_s.nat64 = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ( fun ( _: unit ) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75 ) ( va_QEmpty ( () ) ) ) ) ) ) ) ) ) ) ) )) )))))))))))) ))))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_code_Fmul1_stdcall
val va_code_Fmul1_stdcall : win:bool -> Tot va_code
val va_code_Fmul1_stdcall : win:bool -> Tot va_code
let va_code_Fmul1_stdcall win = (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 76, "end_line": 2866, "start_col": 0, "start_line": 2855 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Fmul1_stdcall #push-options "--z3rlimit 600"
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> Vale.X64.Decls.va_code
Prims.Tot
[ "total" ]
[]
[ "Prims.bool", "Vale.X64.Decls.va_Block", "Vale.X64.Decls.va_CCons", "Vale.X64.InsStack.va_code_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_CNil", "Vale.X64.Decls.va_code", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1", "Vale.X64.InsStack.va_code_Pop_Secret" ]
[]
false
false
false
true
false
let va_code_Fmul1_stdcall win =
(va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))))))))
false
UnionFind.Functions.fst
UnionFind.Functions.height
val height (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot nat
val height (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot nat
let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i))
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 116, "end_line": 30, "start_col": 7, "start_line": 30 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *)
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i: UnionFind.Forest.id n -> h: FStar.DM4F.Heap.heap -> Prims.GTot Prims.nat
Prims.GTot
[ "sometrivial" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.DM4F.Heap.heap", "FStar.Pervasives.Native.__proj__Mktuple3__item___2", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "FStar.DM4F.Heap.sel", "UnionFind.Forest.elt", "FStar.Seq.Base.index", "FStar.DM4F.Heap.ref" ]
[]
false
false
false
false
false
let height (#n: nat) (uf: uf_forest n) (i: id n) (h: heap) : GTot nat =
Mktuple3?._2 (sel h (index uf i))
false
Vale.Wrapper.X64.GCM_IV.fsti
Vale.Wrapper.X64.GCM_IV.uint8_p
val uint8_p : Type0
let uint8_p = B.buffer UInt8.t
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCM_IV.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 30, "end_line": 19, "start_col": 0, "start_line": 19 }
module Vale.Wrapper.X64.GCM_IV open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.Interop.Base open Vale.Def.Types_s open Vale.AES.OptPublic
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.AES_s.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCM_IV.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCM_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Wrapper.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Wrapper.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Type0
Prims.Tot
[ "total" ]
[]
[ "LowStar.Buffer.buffer", "FStar.UInt8.t" ]
[]
false
false
false
true
true
let uint8_p =
B.buffer UInt8.t
false
UnionFind.Functions.fst
UnionFind.Functions.diff
val diff (n: nat) (s: subtree_t) : Tot nat
val diff (n: nat) (s: subtree_t) : Tot nat
let diff (n:nat) (s:subtree_t) :Tot nat = size (minus (set_n n) s)
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 66, "end_line": 48, "start_col": 0, "start_line": 48 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful *) let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h))) //either i is its own parent or subtree of i is a strict subset of subtree of p
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> s: UnionFind.Forest.subtree_t -> Prims.nat
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "UnionFind.Forest.subtree_t", "FStar.OrdSet.size", "Prims.op_LessThanOrEqual", "Prims.bool", "FStar.OrdSet.minus", "UnionFind.Forest.set_n" ]
[]
false
false
false
true
false
let diff (n: nat) (s: subtree_t) : Tot nat =
size (minus (set_n n) s)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fmul1_stdcall
val va_codegen_success_Fmul1_stdcall : win:bool -> Tot va_pbool
val va_codegen_success_Fmul1_stdcall : win:bool -> Tot va_pbool
let va_codegen_success_Fmul1_stdcall win = (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ())))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fmul1 ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ()))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 87, "end_line": 2881, "start_col": 0, "start_line": 2869 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Fmul1_stdcall #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1_stdcall win = (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ())))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.bool", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsStack.va_codegen_success_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fmul1", "Vale.X64.InsStack.va_codegen_success_Pop_Secret" ]
[]
false
false
false
true
false
let va_codegen_success_Fmul1_stdcall win =
(va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ())))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fmul1 ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi) ) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rR13 )) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi )) (va_ttrue ()))))))))))
false
UnionFind.Functions.fst
UnionFind.Functions.well_formed
val well_formed : uf: UnionFind.Forest.uf_forest n -> h: FStar.DM4F.Heap.heap -> Prims.logical
let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h)))
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 51, "end_line": 45, "start_col": 0, "start_line": 37 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> h: FStar.DM4F.Heap.heap -> Prims.logical
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "FStar.DM4F.Heap.heap", "Prims.l_Forall", "UnionFind.Forest.id", "Prims.l_and", "Prims.b2t", "FStar.OrdSet.mem", "Prims.op_LessThanOrEqual", "Prims.bool", "FStar.OrdSet.subset", "UnionFind.Forest.set_n", "Prims.l_imp", "Prims.op_disEquality", "Prims.op_Equality", "UnionFind.Functions.parent", "Prims.eq2", "FStar.OrdSet.ordset", "FStar.OrdSet.intersect", "UnionFind.Functions.subtree", "FStar.OrdSet.empty", "FStar.DM4F.Heap.sel", "UnionFind.Forest.elt", "FStar.Seq.Base.index", "FStar.DM4F.Heap.ref", "Prims.l_or", "FStar.OrdSet.strict_subset", "UnionFind.Forest.subtree_t", "Prims.logical" ]
[]
false
false
false
false
true
let well_formed (#n: nat) (uf: uf_forest n) (h: heap) =
forall (i: id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ subset s (set_n n) /\ (forall (j: id n). {:pattern (sel h (index uf j))} (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h)))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fast_add
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1864, "start_col": 0, "start_line": 1834 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_add", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Addition", "Vale.X64.Decls.valid_cf", "Vale.X64.Decls.va_get_flags", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_five", "Vale.X64.Decls.va_get_reg64", "Vale.Curve25519.Fast_defs.bool_bit", "Vale.X64.Decls.cf", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_add" ]
[]
false
false
false
false
false
let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok ] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
false
UnionFind.Functions.fst
UnionFind.Functions.find
val find (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap)))
val find (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap)))
let rec find (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, _, _) = get uf i in if p = i then i else find uf p ghost_heap
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 29, "end_line": 59, "start_col": 1, "start_line": 53 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful *) let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h))) //either i is its own parent or subtree of i is a strict subset of subtree of p (* the metric that decreases in the recursive calls *) let diff (n:nat) (s:subtree_t) :Tot nat = size (minus (set_n n) s) (* * the postcondition parent uf r h1 = r is added because of merge, see below in comments
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i: UnionFind.Forest.id n -> ghost_heap: FStar.DM4F.Heap.heap -> FStar.DM4F.Heap.ST.ST (UnionFind.Forest.id n)
FStar.DM4F.Heap.ST.ST
[ "" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.DM4F.Heap.heap", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "Prims.op_Equality", "Prims.bool", "UnionFind.Functions.find", "UnionFind.Forest.elt", "UnionFind.Forest.get", "Prims.l_and", "Prims.eq2", "UnionFind.Forest.live", "UnionFind.Functions.well_formed", "Prims.b2t", "UnionFind.Functions.parent" ]
[ "recursion" ]
false
true
false
false
false
let rec find (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap))) =
let p, _, _ = get uf i in if p = i then i else find uf p ghost_heap
false
Vale.Wrapper.X64.GCM_IV.fsti
Vale.Wrapper.X64.GCM_IV.uint64
val uint64 : Prims.eqtype
let uint64 = UInt64.t
{ "file_name": "vale/code/arch/x64/interop/Vale.Wrapper.X64.GCM_IV.fsti", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 21, "end_line": 20, "start_col": 0, "start_line": 20 }
module Vale.Wrapper.X64.GCM_IV open Vale.X64.CPU_Features_s open FStar.HyperStack.ST module B = LowStar.Buffer module HS = FStar.HyperStack module DV = LowStar.BufferView.Down module UV = LowStar.BufferView.Up open FStar.Mul open Vale.Def.Words_s open Vale.Def.Words.Seq_s open Vale.AES.AES_s open Vale.AES.GCM_s open Vale.Interop.Base open Vale.Def.Types_s open Vale.AES.OptPublic unfold
{ "checked_file": "/", "dependencies": [ "Vale.X64.CPU_Features_s.fst.checked", "Vale.Interop.Base.fst.checked", "Vale.Def.Words_s.fsti.checked", "Vale.Def.Words.Seq_s.fsti.checked", "Vale.Def.Types_s.fst.checked", "Vale.AES.OptPublic.fsti.checked", "Vale.AES.GCM_s.fst.checked", "Vale.AES.AES_s.fst.checked", "prims.fst.checked", "LowStar.BufferView.Up.fsti.checked", "LowStar.BufferView.Down.fsti.checked", "LowStar.Buffer.fst.checked", "FStar.UInt8.fsti.checked", "FStar.UInt64.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Vale.Wrapper.X64.GCM_IV.fsti" }
[ { "abbrev": false, "full_module": "Vale.AES.OptPublic", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Interop.Base", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.GCM_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.AES.AES_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words.Seq_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Words_s", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "LowStar.BufferView.Up", "short_module": "UV" }, { "abbrev": true, "full_module": "LowStar.BufferView.Down", "short_module": "DV" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "LowStar.Buffer", "short_module": "B" }, { "abbrev": false, "full_module": "FStar.HyperStack.ST", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Wrapper.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Wrapper.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Prims.eqtype
Prims.Tot
[ "total" ]
[]
[ "FStar.UInt64.t" ]
[]
false
false
false
true
false
let uint64 =
UInt64.t
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Carry_wide
val va_lemma_Carry_wide : va_b0:va_code -> va_s0:va_state -> offset:nat -> dst_b:buffer64 -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_wide offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset `op_Multiply` 2) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == a `op_Modulus` prime /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))
val va_lemma_Carry_wide : va_b0:va_code -> va_s0:va_state -> offset:nat -> dst_b:buffer64 -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_wide offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset `op_Multiply` 2) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == a `op_Modulus` prime /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))))
let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1489, "start_col": 0, "start_line": 1441 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (()))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> offset: Prims.nat -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.nat", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Carry_wide", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Vale.X64.Decls.validSrcAddrs64", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRdi", "Prims.op_Addition", "Vale.X64.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.X64.Decls.modifies_buffer_specific", "Prims.op_Subtraction", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.Curve25519.Fast_defs.pow2_eight", "Prims.op_Multiply", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Carry_wide" ]
[]
false
false
false
false
false
let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a4:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a5:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a6:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a7:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fmul1
val va_codegen_success_Fmul1 : va_dummy:unit -> Tot va_pbool
val va_codegen_success_Fmul1 : va_dummy:unit -> Tot va_pbool
let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 64, "end_line": 2754, "start_col": 0, "start_line": 2746 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_dummy: Prims.unit -> Vale.X64.Decls.va_pbool
Prims.Tot
[ "total" ]
[]
[ "Prims.unit", "Vale.X64.Decls.va_pbool_and", "Vale.X64.InsMem.va_codegen_success_CreateHeaplets", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Fast_mul1", "Vale.X64.InsBasic.va_codegen_success_LargeComment", "Vale.X64.InsBasic.va_codegen_success_Comment", "Vale.X64.InsBasic.va_codegen_success_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Decls.va_const_opr64", "Vale.Curve25519.X64.FastHybrid.va_codegen_success_Carry_pass", "Vale.X64.InsMem.va_codegen_success_DestroyHeaplets", "Vale.X64.Decls.va_ttrue", "Vale.X64.Decls.va_pbool" ]
[]
false
false
false
true
false
let va_codegen_success_Fmul1 () =
(va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field") (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38") (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))))
false
UnionFind.Functions.fst
UnionFind.Functions.merge
val merge (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1))
val merge (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1))
let merge (#n:nat) (uf:uf_forest n) (i_1:id n) (i_2:id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1)) = let r_1 = find uf i_1 (ST.get ()) in let r_2 = find uf i_2 (ST.get ()) in let _, d_1, s_1 = get uf r_1 in let _, d_2, s_2 = get uf r_2 in if r_1 = r_2 then () else begin set uf r_1 (r_2, d_1, s_1); //let d_2 = if d_1 >= d_2 then d_1 + 1 else d_2 in set uf r_2 (r_2, d_2, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))) end
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 7, "end_line": 99, "start_col": 1, "start_line": 85 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful *) let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h))) //either i is its own parent or subtree of i is a strict subset of subtree of p (* the metric that decreases in the recursive calls *) let diff (n:nat) (s:subtree_t) :Tot nat = size (minus (set_n n) s) (* * the postcondition parent uf r h1 = r is added because of merge, see below in comments *) let rec find (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, _, _) = get uf i in if p = i then i else find uf p ghost_heap #set-options "--z3rlimit 20" let rec find_opt (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ //these are from find (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ //we need this because when we write p' as i's parent //we need to ensure well-formedness i.e. subtree of p' //is a strict superset of subtree of i (forall (j:id n).{:pattern (sel h1 (index uf j)) \/ (sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) //this last clause to say that i remains unchanged in the recursive call, else when we write its subtree to be s, we have trouble proving that p's subtree is a strict superset of s (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, d, s) = get uf i in if p = i then i else let h = ST.get () in let p' = find_opt uf p h in set uf i (p', d, s); p' #reset-options let well_formed_decreases_lemma (#n:nat) (uf:uf_forest n) (i:id n) (h:heap{live uf h /\ well_formed uf h}) :Lemma (let p, _, _ = sel h (index uf i) in p = i \/ diff n (subtree #n uf i h) > diff n (subtree #n uf p h)) = ()
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i_1: UnionFind.Forest.id n -> i_2: UnionFind.Forest.id n -> FStar.DM4F.Heap.ST.ST Prims.unit
FStar.DM4F.Heap.ST.ST
[]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "Prims.op_Equality", "Prims.unit", "Prims.bool", "Prims._assert", "Prims.b2t", "FStar.OrdSet.strict_subset", "Prims.op_LessThanOrEqual", "FStar.Ghost.reveal", "FStar.OrdSet.union", "UnionFind.Forest.set", "FStar.Pervasives.Native.Mktuple3", "FStar.Ghost.elift2", "UnionFind.Forest.elt", "UnionFind.Forest.get", "UnionFind.Functions.find", "FStar.DM4F.Heap.heap", "FStar.DM4F.Heap.ST.get", "Prims.l_and", "UnionFind.Forest.live", "UnionFind.Functions.well_formed" ]
[]
false
true
false
false
false
let merge (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1)) =
let r_1 = find uf i_1 (ST.get ()) in let r_2 = find uf i_2 (ST.get ()) in let _, d_1, s_1 = get uf r_1 in let _, d_2, s_2 = get uf r_2 in if r_1 = r_2 then () else (set uf r_1 (r_2, d_1, s_1); set uf r_2 (r_2, d_2, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fast_sub
val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2168, "start_col": 0, "start_line": 2159 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Memory.buffer64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fast_sub", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub" ]
[]
false
false
false
false
false
let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))) )))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8 ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.ptr_of
val ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt)
val ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt)
let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 19, "end_line": 90, "start_col": 0, "start_line": 85 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Steel.ST.HigherArray.array elt -> Steel.ST.HigherArray.ptr elt
Prims.Tot
[ "total" ]
[]
[ "Steel.ST.HigherArray.array", "Steel.ST.HigherArray.ptr", "FStar.Ghost.erased", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base" ]
[]
false
false
false
true
false
let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) =
match a with | (| p , _ |) -> p
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.array
val array ([@@@ strictly_positive]elt: Type u#a) : Tot Type0
val array ([@@@ strictly_positive]elt: Type u#a) : Tot Type0
let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)}))
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 84, "end_line": 75, "start_col": 0, "start_line": 74 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
elt: Type -> Type0
Prims.Tot
[ "total" ]
[]
[ "Prims.dtuple2", "Steel.ST.HigherArray.ptr", "FStar.Ghost.erased", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base" ]
[]
false
false
false
true
true
let array ([@@@ strictly_positive]elt: Type u#a) : Tot Type0 =
(p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)}))
false
UnionFind.Functions.fst
UnionFind.Functions.find_opt
val find_opt (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ (forall (j: id n). {:pattern (sel h1 (index uf j))\/(sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) (decreases (diff n (subtree #n uf i ghost_heap)))
val find_opt (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ (forall (j: id n). {:pattern (sel h1 (index uf j))\/(sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) (decreases (diff n (subtree #n uf i ghost_heap)))
let rec find_opt (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ //these are from find (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ //we need this because when we write p' as i's parent //we need to ensure well-formedness i.e. subtree of p' //is a strict superset of subtree of i (forall (j:id n).{:pattern (sel h1 (index uf j)) \/ (sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) //this last clause to say that i remains unchanged in the recursive call, else when we write its subtree to be s, we have trouble proving that p's subtree is a strict superset of s (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, d, s) = get uf i in if p = i then i else let h = ST.get () in let p' = find_opt uf p h in set uf i (p', d, s); p'
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 8, "end_line": 77, "start_col": 1, "start_line": 62 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful *) let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h))) //either i is its own parent or subtree of i is a strict subset of subtree of p (* the metric that decreases in the recursive calls *) let diff (n:nat) (s:subtree_t) :Tot nat = size (minus (set_n n) s) (* * the postcondition parent uf r h1 = r is added because of merge, see below in comments *) let rec find (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, _, _) = get uf i in if p = i then i else find uf p ghost_heap
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i: UnionFind.Forest.id n -> ghost_heap: FStar.DM4F.Heap.heap -> FStar.DM4F.Heap.ST.ST (UnionFind.Forest.id n)
FStar.DM4F.Heap.ST.ST
[ "" ]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.DM4F.Heap.heap", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "Prims.op_Equality", "Prims.bool", "Prims.unit", "UnionFind.Forest.set", "FStar.Pervasives.Native.Mktuple3", "UnionFind.Functions.find_opt", "FStar.DM4F.Heap.ST.get", "UnionFind.Forest.elt", "UnionFind.Forest.get", "Prims.l_and", "Prims.eq2", "UnionFind.Forest.live", "UnionFind.Functions.well_formed", "Prims.b2t", "UnionFind.Functions.parent", "Prims.l_or", "FStar.OrdSet.strict_subset", "Prims.op_LessThanOrEqual", "UnionFind.Functions.subtree", "Prims.l_Forall", "Prims.l_imp", "FStar.DM4F.Heap.sel", "FStar.Seq.Base.index", "FStar.DM4F.Heap.ref" ]
[ "recursion" ]
false
true
false
false
false
let rec find_opt (#n: nat) (uf: uf_forest n) (i: id n) (ghost_heap: heap) : ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ (forall (j: id n). {:pattern (sel h1 (index uf j))\/(sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) (decreases (diff n (subtree #n uf i ghost_heap))) =
let p, d, s = get uf i in if p = i then i else let h = ST.get () in let p' = find_opt uf p h in set uf i (p', d, s); p'
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.length
val length (#elt: Type) (a: array elt) : GTot nat
val length (#elt: Type) (a: array elt) : GTot nat
let length (#elt: Type) (a: array elt) : GTot nat = dsnd a
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 8, "end_line": 100, "start_col": 0, "start_line": 99 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p)
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Steel.ST.HigherArray.array elt -> Prims.GTot Prims.nat
Prims.GTot
[ "sometrivial" ]
[]
[ "Steel.ST.HigherArray.array", "FStar.Ghost.reveal", "Prims.nat", "FStar.Pervasives.dsnd", "Steel.ST.HigherArray.ptr", "FStar.Ghost.erased", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base" ]
[]
false
false
false
false
false
let length (#elt: Type) (a: array elt) : GTot nat =
dsnd a
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.is_full_array
val is_full_array (#elt: Type) (a: array elt) : Tot prop
val is_full_array (#elt: Type) (a: array elt) : Tot prop
let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a))
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 40, "end_line": 176, "start_col": 0, "start_line": 175 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Steel.ST.HigherArray.array elt -> Prims.prop
Prims.Tot
[ "total" ]
[]
[ "Steel.ST.HigherArray.array", "Prims.eq2", "Prims.nat", "Steel.ST.HigherArray.length", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.ptr_of", "Prims.prop" ]
[]
false
false
false
true
true
let is_full_array (#elt: Type) (a: array elt) : Tot prop =
length a == base_len (base (ptr_of a))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fadd
val va_wpProof_Fadd : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fadd dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fadd ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fadd : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fadd dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fadd ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2293, "start_col": 0, "start_line": 2281 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Memory.buffer64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fadd", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd" ]
[]
false
false
false
false
false
let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))) ))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n
val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len
val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len
let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 58, "end_line": 36, "start_col": 0, "start_line": 36 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t len -> i: Prims.nat -> b: Hacl.Spec.Bignum.Definitions.lbignum t len -> Hacl.Spec.Bignum.Definitions.lbignum t len
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Hacl.Spec.Bignum.Definitions.lbignum", "Prims.nat", "Hacl.Spec.Bignum.bn_add_mod_n" ]
[]
false
false
false
false
false
let bn_lshift1_mod_n #t #len n i b =
BN.bn_add_mod_n n b b
false
UnionFind.Functions.fst
UnionFind.Functions.merge_opt
val merge_opt (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1))
val merge_opt (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1))
let merge_opt (#n:nat) (uf:uf_forest n) (i_1:id n) (i_2:id n) :ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1)) = let r_1 = find uf i_1 (ST.get ()) in let r_2 = find uf i_2 (ST.get ()) in let _, d_1, s_1 = get uf r_1 in let _, d_2, s_2 = get uf r_2 in if r_1 = r_2 then () else begin if d_1 < d_2 then begin set uf r_1 (r_2, d_1, s_1); set uf r_2 (r_2, d_2, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))) end else begin set uf r_2 (r_1, d_2, s_2); let d_1 = if d_1 = d_2 then d_1 + 1 else d_1 in set uf r_1 (r_1, d_1, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))) end end
{ "file_name": "examples/rel/UnionFind.Functions.fst", "git_rev": "10183ea187da8e8c426b799df6c825e24c0767d3", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
{ "end_col": 7, "end_line": 123, "start_col": 1, "start_line": 101 }
(* Copyright 2008-2018 Microsoft Research 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. *) module UnionFind.Functions open FStar.Seq open FStar.Ghost open FStar.OrdSet open FStar.DM4F.Heap open FStar.DM4F.Heap.ST open UnionFind.Forest module ST = FStar.DM4F.Heap.ST (* helpers for getting the parent, height, and the subtree *) unfold let parent (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot (id n) = Mktuple3?._1 (sel h (index uf i)) unfold let height (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot nat = Mktuple3?._2 (sel h (index uf i)) unfold let subtree (#n:nat) (uf:uf_forest n) (i:id n) (h:heap) :GTot subtree_t = reveal (Mktuple3?._3 (sel h (index uf i))) (* * well-formed conditions on the forest, essentially the invariants needed for proving the termination of operations * my suspicion is that these patterns are not too helpful *) let well_formed (#n:nat) (uf:uf_forest n) (h:heap) = forall (i:id n). {:pattern (sel h (index uf i))} (let p = parent uf i h in let s = subtree uf i h in mem i s /\ //at least i itself is in the subtree subset s (set_n n) /\ //s is a subset of set_n (forall (j:id n). {:pattern (sel h (index uf j))} //different roots have disjoint subtrees (i <> j /\ i = p /\ j = parent uf j h) ==> intersect s (subtree uf j h) == empty) /\ (p = i \/ strict_subset s (subtree uf p h))) //either i is its own parent or subtree of i is a strict subset of subtree of p (* the metric that decreases in the recursive calls *) let diff (n:nat) (s:subtree_t) :Tot nat = size (minus (set_n n) s) (* * the postcondition parent uf r h1 = r is added because of merge, see below in comments *) let rec find (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> h0 == h1 /\ parent uf r h1 = r)) (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, _, _) = get uf i in if p = i then i else find uf p ghost_heap #set-options "--z3rlimit 20" let rec find_opt (#n:nat) (uf:uf_forest n) (i:id n) (ghost_heap:heap) :ST (id n) (requires (fun h0 -> ghost_heap == h0 /\ live uf h0 /\ well_formed uf h0)) (ensures (fun h0 r h1 -> live uf h1 /\ well_formed uf h1 /\ parent uf r h1 = r /\ //these are from find (r = i \/ strict_subset (subtree uf i h1) (subtree uf r h1)) /\ //we need this because when we write p' as i's parent //we need to ensure well-formedness i.e. subtree of p' //is a strict superset of subtree of i (forall (j:id n).{:pattern (sel h1 (index uf j)) \/ (sel h0 (index uf j))} strict_subset (subtree uf j h0) (subtree uf i h0) ==> sel h1 (index uf j) == sel h0 (index uf j)))) //this last clause to say that i remains unchanged in the recursive call, else when we write its subtree to be s, we have trouble proving that p's subtree is a strict superset of s (decreases (diff n (subtree #n uf i ghost_heap))) = let (p, d, s) = get uf i in if p = i then i else let h = ST.get () in let p' = find_opt uf p h in set uf i (p', d, s); p' #reset-options let well_formed_decreases_lemma (#n:nat) (uf:uf_forest n) (i:id n) (h:heap{live uf h /\ well_formed uf h}) :Lemma (let p, _, _ = sel h (index uf i) in p = i \/ diff n (subtree #n uf i h) > diff n (subtree #n uf p h)) = () let merge (#n:nat) (uf:uf_forest n) (i_1:id n) (i_2:id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1)) = let r_1 = find uf i_1 (ST.get ()) in let r_2 = find uf i_2 (ST.get ()) in let _, d_1, s_1 = get uf r_1 in let _, d_2, s_2 = get uf r_2 in if r_1 = r_2 then () else begin set uf r_1 (r_2, d_1, s_1); //let d_2 = if d_1 >= d_2 then d_1 + 1 else d_2 in set uf r_2 (r_2, d_2, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))) end
{ "checked_file": "/", "dependencies": [ "UnionFind.Forest.fst.checked", "prims.fst.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.OrdSet.fsti.checked", "FStar.Ghost.fsti.checked", "FStar.DM4F.Heap.ST.fsti.checked", "FStar.DM4F.Heap.fsti.checked" ], "interface_file": false, "source_file": "UnionFind.Functions.fst" }
[ { "abbrev": true, "full_module": "FStar.DM4F.Heap.ST", "short_module": "ST" }, { "abbrev": false, "full_module": "UnionFind.Forest", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.DM4F.Heap", "short_module": null }, { "abbrev": false, "full_module": "FStar.OrdSet", "short_module": null }, { "abbrev": false, "full_module": "FStar.Ghost", "short_module": null }, { "abbrev": false, "full_module": "FStar.Seq", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "UnionFind", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
uf: UnionFind.Forest.uf_forest n -> i_1: UnionFind.Forest.id n -> i_2: UnionFind.Forest.id n -> FStar.DM4F.Heap.ST.ST Prims.unit
FStar.DM4F.Heap.ST.ST
[]
[]
[ "Prims.nat", "UnionFind.Forest.uf_forest", "UnionFind.Forest.id", "FStar.Ghost.erased", "UnionFind.Forest.subtree_t", "Prims.op_Equality", "Prims.unit", "Prims.bool", "Prims.op_LessThan", "Prims._assert", "Prims.b2t", "FStar.OrdSet.strict_subset", "Prims.op_LessThanOrEqual", "FStar.Ghost.reveal", "FStar.OrdSet.union", "UnionFind.Forest.set", "FStar.Pervasives.Native.Mktuple3", "FStar.Ghost.elift2", "Prims.op_Addition", "UnionFind.Forest.elt", "UnionFind.Forest.get", "UnionFind.Functions.find", "FStar.DM4F.Heap.heap", "FStar.DM4F.Heap.ST.get", "Prims.l_and", "UnionFind.Forest.live", "UnionFind.Functions.well_formed" ]
[]
false
true
false
false
false
let merge_opt (#n: nat) (uf: uf_forest n) (i_1 i_2: id n) : ST unit (requires (fun h0 -> live uf h0 /\ well_formed uf h0)) (ensures (fun h0 _ h1 -> live uf h1 /\ well_formed uf h1)) =
let r_1 = find uf i_1 (ST.get ()) in let r_2 = find uf i_2 (ST.get ()) in let _, d_1, s_1 = get uf r_1 in let _, d_2, s_2 = get uf r_2 in if r_1 = r_2 then () else if d_1 < d_2 then (set uf r_1 (r_2, d_1, s_1); set uf r_2 (r_2, d_2, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2)))) else (set uf r_2 (r_1, d_2, s_2); let d_1 = if d_1 = d_2 then d_1 + 1 else d_1 in set uf r_1 (r_1, d_1, elift2 union s_1 s_2); assert (strict_subset (reveal s_1) (union (reveal s_1) (reveal s_2))))
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.adjacent
val adjacent (#elt: Type) (a1 a2: array elt) : Tot prop
val adjacent (#elt: Type) (a1 a2: array elt) : Tot prop
let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 56, "end_line": 331, "start_col": 0, "start_line": 329 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a1: Steel.ST.HigherArray.array elt -> a2: Steel.ST.HigherArray.array elt -> Prims.prop
Prims.Tot
[ "total" ]
[]
[ "Steel.ST.HigherArray.array", "Prims.l_and", "Prims.eq2", "Steel.ST.HigherArray.base_t", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.ptr_of", "Prims.int", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "Steel.ST.HigherArray.length", "Prims.prop" ]
[]
false
false
false
true
true
let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop =
base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.parse32_bv8
val parse32_bv8:parser32 parse_bv8
val parse32_bv8:parser32 parse_bv8
let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 6, "end_line": 16, "start_col": 0, "start_line": 11 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowParse.SLow.Base.parser32 LowParse.Spec.BitVector.parse_bv8
Prims.Tot
[ "total" ]
[]
[ "LowParse.SLow.Combinators.parse32_synth'", "LowParse.Spec.Int.parse_u8_kind", "FStar.UInt8.t", "FStar.BitVector.bv_t", "LowParse.Spec.Int.parse_u8", "LowParse.Spec.BitVector.synth_bv8", "LowParse.SLow.Int.parse32_u8" ]
[]
false
false
false
false
false
let parse32_bv8:parser32 parse_bv8 =
parse32_synth' _ synth_bv8 parse32_u8 ()
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.merge_into
val merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop
val merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop
let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop = adjacent a1 a2 /\ merge a1 a2 == a
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 18, "end_line": 360, "start_col": 0, "start_line": 358 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction [@@noextract_to "krml"] let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |) /// Adjacency and merging are associative. let merge_assoc (#elt: Type) (a1 a2 a3: array elt) : Lemma (requires ( (adjacent a1 a2 /\ adjacent a2 a3) \/ (adjacent a1 a2 /\ adjacent (merge a1 a2) a3) \/ (adjacent a2 a3 /\ adjacent a1 (merge a2 a3)) )) (ensures ( adjacent (merge a1 a2) a3 /\ adjacent a1 (merge a2 a3) /\ merge (merge a1 a2) a3 == merge a1 (merge a2 a3) )) = ()
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a1: Steel.ST.HigherArray.array elt -> a2: Steel.ST.HigherArray.array elt -> a: Steel.ST.HigherArray.array elt -> Prims.prop
Prims.Tot
[ "total" ]
[]
[ "Steel.ST.HigherArray.array", "Prims.l_and", "Steel.ST.HigherArray.adjacent", "Prims.eq2", "Steel.ST.HigherArray.merge", "FStar.Ghost.hide", "Prims.prop" ]
[]
false
false
false
true
true
let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop =
adjacent a1 a2 /\ merge a1 a2 == a
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fadd_stdcall
val va_qcode_Fadd_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win))
val va_qcode_Fadd_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win))
let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 89, "end_line": 2352, "start_col": 0, "start_line": 2322 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ()))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fadd_stdcall win)
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.QuickCodes.if_code", "Vale.X64.QuickCodes.block", "Vale.X64.InsStack.va_code_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd", "Vale.X64.InsStack.va_code_Pop_Secret", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.QuickCodes.va_range1", "Vale.X64.QuickCodes.va_qInlineIf", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.InsStack.va_quick_Push_Secret", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Curve25519.X64.FastHybrid.va_quick_Fadd", "Vale.X64.InsStack.va_quick_Pop_Secret", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.Def.Types_s.nat64", "Prims.b2t", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd_stdcall" ]
[]
false
false
false
false
false
let va_qcode_Fadd_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let inB_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s: va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QEmpty (()))))))
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.size32_bv8
val size32_bv8:size32 serialize_bv8
val size32_bv8:size32 serialize_bv8
let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 38, "end_line": 29, "start_col": 0, "start_line": 28 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowParse.SLow.Base.size32 LowParse.Spec.BitVector.serialize_bv8
Prims.Tot
[ "total" ]
[]
[ "LowParse.SLow.Base.size32_constant", "LowParse.Spec.BitVector.parse_bv8_kind", "FStar.BitVector.bv_t", "LowParse.Spec.BitVector.parse_bv8", "LowParse.Spec.BitVector.serialize_bv8", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
false
false
let size32_bv8:size32 serialize_bv8 =
size32_constant serialize_bv8 1ul ()
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Carry_pass
val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 1315, "start_col": 0, "start_line": 1277 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> use_cf: Prims.bool -> offset: Prims.nat -> dst_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Prims.nat", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Carry_pass", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Curve25519.Fast_defs.prime", "Prims.op_Addition", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Decls.va_mul_nat", "Vale.Curve25519.Fast_defs.pow2_256", "Vale.X64.Decls.modifies_buffer_specific", "Vale.X64.Decls.va_get_mem_heaplet", "Prims.op_Subtraction", "Vale.X64.Decls.validSrcAddrs64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Decls.va_get_mem_layout", "Vale.Arch.HeapTypes_s.Secret", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_if", "Vale.X64.Decls.cf", "Vale.X64.Decls.va_get_flags", "Prims.l_not", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Carry_pass" ]
[]
false
false
false
false
false
let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b =
let va_mods:va_mods_t = [ va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let carry_in:nat64 = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ((Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.size32_extra_bv8
val size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n))
val size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n))
let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 26, "end_line": 83, "start_col": 0, "start_line": 82 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> LowParse.SLow.Base.size32 (LowParse.Spec.BitVector.serialize_extra_bv8 n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "LowParse.SLow.Base.size32_constant", "LowParse.Spec.BitVector.parse_extra_bv8_kind", "FStar.BitVector.bv_t", "Prims.op_Modulus", "LowParse.Spec.BitVector.parse_extra_bv8", "LowParse.Spec.BitVector.serialize_extra_bv8", "FStar.UInt32.__uint_to_t", "LowParse.SLow.Base.size32" ]
[]
false
false
false
false
false
let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) =
size32_constant _ 1ul ()
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.serialize32_bv
val serialize32_bv (n: nat{n / 8 < 4294967295}) : Tot (serializer32 (serialize_bv n))
val serialize32_bv (n: nat{n / 8 < 4294967295}) : Tot (serializer32 (serialize_bv n))
let serialize32_bv (n: nat { n / 8 < 4294967295 }) : Tot (serializer32 (serialize_bv n)) = if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ (serialize32_extra_bv8 n `serialize32_nondep_then` serialize32_byte_bv (n / 8)) (synth_bv_recip n) (fun x -> synth_bv_recip n x) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 8, "end_line": 106, "start_col": 0, "start_line": 94 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul () let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat{n / 8 < 4294967295} -> LowParse.SLow.Base.serializer32 (LowParse.Spec.BitVector.serialize_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Division", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "LowParse.SLow.BitVector.serialize32_byte_bv", "Prims.bool", "LowParse.SLow.Combinators.serialize32_synth", "LowParse.Spec.Combinators.and_then_kind", "LowParse.Spec.BitVector.parse_extra_bv8_kind", "LowParse.Spec.BitVector.parse_byte_bv_kind", "FStar.Pervasives.Native.tuple2", "FStar.BitVector.bv_t", "FStar.Mul.op_Star", "LowParse.Spec.Combinators.nondep_then", "LowParse.Spec.BitVector.parse_extra_bv8", "LowParse.Spec.BitVector.parse_byte_bv", "LowParse.Spec.BitVector.synth_bv", "LowParse.Spec.Combinators.serialize_nondep_then", "LowParse.Spec.BitVector.serialize_extra_bv8", "LowParse.Spec.BitVector.serialize_byte_bv", "LowParse.SLow.Combinators.serialize32_nondep_then", "LowParse.SLow.BitVector.serialize32_extra_bv8", "LowParse.Spec.BitVector.synth_bv_recip", "Prims.eq2", "LowParse.SLow.Base.serializer32", "LowParse.Spec.BitVector.parse_bv_kind", "LowParse.Spec.BitVector.parse_bv", "LowParse.Spec.BitVector.serialize_bv" ]
[]
false
false
false
false
false
let serialize32_bv (n: nat{n / 8 < 4294967295}) : Tot (serializer32 (serialize_bv n)) =
if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ ((serialize32_extra_bv8 n) `serialize32_nondep_then` (serialize32_byte_bv (n / 8))) (synth_bv_recip n) (fun x -> synth_bv_recip n x) ()
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.serialize32_bv8
val serialize32_bv8:serializer32 serialize_bv8
val serialize32_bv8:serializer32 serialize_bv8
let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 6, "end_line": 26, "start_col": 0, "start_line": 18 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
LowParse.SLow.Base.serializer32 LowParse.Spec.BitVector.serialize_bv8
Prims.Tot
[ "total" ]
[]
[ "LowParse.SLow.Combinators.serialize32_synth", "LowParse.Spec.Int.parse_u8_kind", "FStar.UInt8.t", "FStar.BitVector.bv_t", "LowParse.Spec.Int.parse_u8", "LowParse.Spec.BitVector.synth_bv8", "LowParse.Spec.Int.serialize_u8", "LowParse.SLow.Int.serialize32_u8", "LowParse.Spec.BitVector.synth_bv8_recip", "Prims.eq2" ]
[]
false
false
false
false
false
let serialize32_bv8:serializer32 serialize_bv8 =
serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) ()
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fast_sub
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2111, "start_col": 0, "start_line": 2081 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.QuickCode.va_Mod_ok", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_sub", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Subtraction", "Vale.X64.Decls.va_mul_nat", "Vale.Curve25519.Fast_defs.bool_bit", "Vale.X64.Decls.cf", "Vale.X64.Decls.va_get_flags", "Vale.Curve25519.Fast_defs.pow2_256", "Vale.X64.Decls.valid_cf", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.X64.Decls.va_get_reg64", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem_heaplet", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fast_sub" ]
[]
false
false
false
false
false
let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok ] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM ))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok ]) va_sM va_s0; (va_sM, va_fM)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.parse32_bounded_bv
val parse32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp))
val parse32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp))
let parse32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp)) = parse32_dtuple2 hp32 (fun (x: bounded_int32 min max) -> parse32_weaken (parse_bounded_bv_payload_kind min max) (parse32_bv (U32.v x)))
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 117, "end_line": 120, "start_col": 0, "start_line": 111 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul () let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) () let serialize32_bv (n: nat { n / 8 < 4294967295 }) : Tot (serializer32 (serialize_bv n)) = if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ (serialize32_extra_bv8 n `serialize32_nondep_then` serialize32_byte_bv (n / 8)) (synth_bv_recip n) (fun x -> synth_bv_recip n x) () let size32_bv (n: nat { n / 8 < 4294967295 }) : Tot (size32 (serialize_bv n)) = size32_constant _ (if n % 8 = 0 then U32.uint_to_t (n / 8) else U32.uint_to_t (1 + n / 8)) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
min: Prims.nat -> max: Prims.nat{min <= max} -> hp32: LowParse.SLow.Base.parser32 hp -> LowParse.SLow.Base.parser32 (LowParse.Spec.BitVector.parse_bounded_bv min max hp)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "LowParse.Spec.Base.parser_kind", "LowParse.Spec.Base.parser", "LowParse.Spec.BoundedInt.bounded_int32", "LowParse.SLow.Base.parser32", "LowParse.SLow.Combinators.parse32_dtuple2", "LowParse.Spec.BitVector.parse_bounded_bv_payload_kind", "FStar.BitVector.bv_t", "FStar.UInt32.v", "LowParse.Spec.Base.weaken", "LowParse.Spec.BitVector.parse_bv_kind", "LowParse.Spec.BitVector.parse_bv", "LowParse.SLow.Combinators.parse32_weaken", "LowParse.SLow.BitVector.parse32_bv", "LowParse.Spec.BitVector.parse_bounded_bv_kind", "LowParse.Spec.BitVector.bounded_bv_t", "LowParse.Spec.BitVector.parse_bounded_bv" ]
[]
false
false
false
false
false
let parse32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp)) =
parse32_dtuple2 hp32 (fun (x: bounded_int32 min max) -> parse32_weaken (parse_bounded_bv_payload_kind min max) (parse32_bv (U32.v x)))
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.serialize32_extra_bv8
val serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n))
val serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n))
let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 6, "end_line": 80, "start_col": 0, "start_line": 70 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> LowParse.SLow.Base.serializer32 (LowParse.Spec.BitVector.serialize_extra_bv8 n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "LowParse.SLow.Combinators.serialize32_synth", "LowParse.Spec.Combinators.parse_filter_kind", "LowParse.Spec.Int.parse_u8_kind", "LowParse.Spec.Combinators.parse_filter_refine", "FStar.UInt8.t", "LowParse.Spec.BitVector.extra_bytes_prop", "FStar.BitVector.bv_t", "Prims.op_Modulus", "LowParse.Spec.Combinators.parse_filter", "LowParse.Spec.Int.parse_u8", "LowParse.Spec.BitVector.synth_extra_bv8", "LowParse.Spec.Combinators.serialize_filter", "LowParse.Spec.Int.serialize_u8", "LowParse.SLow.Combinators.serialize32_filter", "LowParse.SLow.Int.serialize32_u8", "LowParse.Spec.BitVector.synth_extra_bv8_recip", "Prims.eq2", "LowParse.SLow.Base.serializer32", "LowParse.Spec.BitVector.parse_extra_bv8_kind", "LowParse.Spec.BitVector.parse_extra_bv8", "LowParse.Spec.BitVector.serialize_extra_bv8" ]
[]
false
false
false
false
false
let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) =
serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) ()
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n_lemma
val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n)
val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n)
let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 29, "end_line": 42, "start_col": 0, "start_line": 41 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t len -> i: Prims.nat -> b: Hacl.Spec.Bignum.Definitions.lbignum t len -> FStar.Pervasives.Lemma (requires 0 < Hacl.Spec.Bignum.Definitions.bn_v n /\ Hacl.Spec.Bignum.Definitions.bn_v b < Hacl.Spec.Bignum.Definitions.bn_v n) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n n i b) == 2 * Hacl.Spec.Bignum.Definitions.bn_v b % Hacl.Spec.Bignum.Definitions.bn_v n)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Hacl.Spec.Bignum.Definitions.lbignum", "Prims.nat", "Hacl.Spec.Bignum.bn_add_mod_n_lemma", "Prims.unit" ]
[]
true
false
true
false
false
let bn_lshift1_mod_n_lemma #t #len n i b =
BN.bn_add_mod_n_lemma n b b
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fsub_stdcall
val va_qcode_Fsub_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win))
val va_qcode_Fsub_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win))
let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 89, "end_line": 2619, "start_col": 0, "start_line": 2589 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ()))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fsub_stdcall win)
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.QuickCodes.if_code", "Vale.X64.QuickCodes.block", "Vale.X64.InsStack.va_code_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub", "Vale.X64.InsStack.va_code_Pop_Secret", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.QuickCodes.va_range1", "Vale.X64.QuickCodes.va_qInlineIf", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.InsStack.va_quick_Push_Secret", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Curve25519.X64.FastHybrid.va_quick_Fsub", "Vale.X64.InsStack.va_quick_Pop_Secret", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.Def.Types_s.nat64", "Prims.b2t", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub_stdcall" ]
[]
false
false
false
false
false
let va_qcode_Fsub_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b inB_b: buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let inB_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s: va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QEmpty (()))))))
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.parse32_bv
val parse32_bv (n: nat) : Tot (parser32 (parse_bv n))
val parse32_bv (n: nat) : Tot (parser32 (parse_bv n))
let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 6, "end_line": 92, "start_col": 0, "start_line": 85 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> LowParse.SLow.Base.parser32 (LowParse.Spec.BitVector.parse_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "LowParse.SLow.BitVector.parse32_byte_bv", "Prims.op_Division", "Prims.bool", "LowParse.SLow.Combinators.parse32_synth'", "LowParse.Spec.Combinators.and_then_kind", "LowParse.Spec.BitVector.parse_extra_bv8_kind", "LowParse.Spec.BitVector.parse_byte_bv_kind", "FStar.Pervasives.Native.tuple2", "FStar.BitVector.bv_t", "FStar.Mul.op_Star", "LowParse.Spec.Combinators.nondep_then", "LowParse.Spec.BitVector.parse_extra_bv8", "LowParse.Spec.BitVector.parse_byte_bv", "LowParse.Spec.BitVector.synth_bv", "LowParse.SLow.Combinators.parse32_nondep_then", "LowParse.SLow.BitVector.parse32_extra_bv8", "LowParse.SLow.Base.parser32", "LowParse.Spec.BitVector.parse_bv_kind", "LowParse.Spec.BitVector.parse_bv" ]
[]
false
false
false
false
false
let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) =
if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) ((parse32_extra_bv8 n) `parse32_nondep_then` (parse32_byte_bv (n / 8))) ()
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.size32_byte_bv
val size32_byte_bv (n: nat{n < 4294967296}) : Tot (size32 (serialize_byte_bv n))
val size32_byte_bv (n: nat{n < 4294967296}) : Tot (size32 (serialize_byte_bv n))
let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 124, "end_line": 61, "start_col": 0, "start_line": 61 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat{n < 4294967296} -> LowParse.SLow.Base.size32 (LowParse.Spec.BitVector.serialize_byte_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "LowParse.SLow.Base.size32_constant", "LowParse.Spec.BitVector.parse_byte_bv_kind", "FStar.BitVector.bv_t", "FStar.Mul.op_Star", "LowParse.Spec.BitVector.parse_byte_bv", "LowParse.Spec.BitVector.serialize_byte_bv", "FStar.UInt32.uint_to_t", "LowParse.SLow.Base.size32" ]
[]
false
false
false
false
false
let size32_byte_bv (n: nat{n < 4294967296}) : Tot (size32 (serialize_byte_bv n)) =
size32_constant _ (U32.uint_to_t n) ()
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.size32_bv
val size32_bv (n: nat{n / 8 < 4294967295}) : Tot (size32 (serialize_bv n))
val size32_bv (n: nat{n / 8 < 4294967295}) : Tot (size32 (serialize_bv n))
let size32_bv (n: nat { n / 8 < 4294967295 }) : Tot (size32 (serialize_bv n)) = size32_constant _ (if n % 8 = 0 then U32.uint_to_t (n / 8) else U32.uint_to_t (1 + n / 8)) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 95, "end_line": 109, "start_col": 0, "start_line": 108 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul () let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) () let serialize32_bv (n: nat { n / 8 < 4294967295 }) : Tot (serializer32 (serialize_bv n)) = if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ (serialize32_extra_bv8 n `serialize32_nondep_then` serialize32_byte_bv (n / 8)) (synth_bv_recip n) (fun x -> synth_bv_recip n x) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat{n / 8 < 4294967295} -> LowParse.SLow.Base.size32 (LowParse.Spec.BitVector.serialize_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Division", "LowParse.SLow.Base.size32_constant", "LowParse.Spec.BitVector.parse_bv_kind", "FStar.BitVector.bv_t", "LowParse.Spec.BitVector.parse_bv", "LowParse.Spec.BitVector.serialize_bv", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "FStar.UInt32.uint_to_t", "Prims.bool", "Prims.op_Addition", "FStar.UInt32.t", "LowParse.SLow.Base.size32" ]
[]
false
false
false
false
false
let size32_bv (n: nat{n / 8 < 4294967295}) : Tot (size32 (serialize_bv n)) =
size32_constant _ (if n % 8 = 0 then U32.uint_to_t (n / 8) else U32.uint_to_t (1 + n / 8)) ()
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fsub
val va_wpProof_Fsub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fsub dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fsub ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fsub : dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fsub dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fsub ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2560, "start_col": 0, "start_line": 2549 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Memory.buffer64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fsub", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub" ]
[]
false
false
false
false
false
let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.parse32_extra_bv8
val parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n))
val parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n))
let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 6, "end_line": 68, "start_col": 0, "start_line": 63 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> LowParse.SLow.Base.parser32 (LowParse.Spec.BitVector.parse_extra_bv8 n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "LowParse.SLow.Combinators.parse32_synth'", "LowParse.Spec.Combinators.parse_filter_kind", "LowParse.Spec.Int.parse_u8_kind", "LowParse.Spec.Combinators.parse_filter_refine", "FStar.UInt8.t", "LowParse.Spec.BitVector.extra_bytes_prop", "FStar.BitVector.bv_t", "Prims.op_Modulus", "LowParse.Spec.Combinators.parse_filter", "LowParse.Spec.Int.parse_u8", "LowParse.Spec.BitVector.synth_extra_bv8", "LowParse.SLow.Combinators.parse32_filter", "LowParse.SLow.Int.parse32_u8", "Prims.bool", "Prims.eq2", "LowParse.SLow.Base.parser32", "LowParse.Spec.BitVector.parse_extra_bv8_kind", "LowParse.Spec.BitVector.parse_extra_bv8" ]
[]
false
false
false
false
false
let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) =
parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) ()
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fmul1
val va_wpProof_Fmul1 : dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fmul1 dst_b inA_b inB va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fmul1 ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fmul1 : dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fmul1 dst_b inA_b inB va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fmul1 ()) ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2847, "start_col": 0, "start_line": 2835 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB: Vale.X64.Memory.nat64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fmul1", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1" ]
[]
false
false
false
false
false
let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fadd
val va_lemma_Fadd : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fadd ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a + b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))
val va_lemma_Fadd : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fadd ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a + b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))
let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2277, "start_col": 0, "start_line": 2241 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Prims.op_Addition", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fadd" ]
[]
false
false
false
false
false
let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.parse32_byte_bv
val parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n))
val parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n))
let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 8, "end_line": 40, "start_col": 0, "start_line": 31 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul ()
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat -> LowParse.SLow.Base.parser32 (LowParse.Spec.BitVector.parse_byte_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.op_Equality", "Prims.int", "LowParse.SLow.Combinators.parse32_ret", "FStar.BitVector.bv_t", "FStar.Mul.op_Star", "FStar.Seq.Base.empty", "Prims.bool", "LowParse.SLow.Combinators.parse32_synth'", "LowParse.Spec.Combinators.and_then_kind", "LowParse.Spec.BitVector.parse_bv8_kind", "LowParse.Spec.BitVector.parse_byte_bv_kind", "Prims.op_Subtraction", "FStar.Pervasives.Native.tuple2", "LowParse.Spec.Combinators.nondep_then", "LowParse.Spec.BitVector.parse_bv8", "LowParse.Spec.BitVector.parse_byte_bv", "LowParse.Spec.BitVector.synth_byte_bv", "LowParse.SLow.Combinators.parse32_nondep_then", "LowParse.SLow.BitVector.parse32_bv8", "LowParse.SLow.BitVector.parse32_byte_bv", "LowParse.SLow.Base.parser32", "Prims.unit", "LowParse.Spec.BitVector.parse_byte_bv_kind_eq" ]
[ "recursion" ]
false
false
false
false
false
let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) =
parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` (parse32_byte_bv (n - 1))) ()
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.null
val null (#a: Type u#a) : array a
val null (#a: Type u#a) : array a
let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 32, "end_line": 80, "start_col": 0, "start_line": 79 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
Steel.ST.HigherArray.array a
Prims.Tot
[ "total" ]
[]
[ "Prims.Mkdtuple2", "Steel.ST.HigherArray.ptr", "FStar.Ghost.erased", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.null_ptr", "FStar.Ghost.hide", "Steel.ST.HigherArray.array" ]
[]
false
false
false
true
false
let null (#a: Type u#a) : array a =
(| null_ptr a, Ghost.hide 0 |)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_t
val bn_mont_reduction_t : j: Lib.IntTypes.size_nat{j <= nLen} -> Type0
let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen))
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 44, "end_line": 112, "start_col": 0, "start_line": 111 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
j: Lib.IntTypes.size_nat{j <= nLen} -> Type0
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.Base.carry", "Hacl.Spec.Bignum.Definitions.lbignum" ]
[]
false
false
false
false
true
let bn_mont_reduction_t (#t: limb_t) (#nLen: size_nat{nLen + nLen <= max_size_t}) (j: size_nat{j <= nLen}) =
tuple2 (carry t) (lbignum t (nLen + nLen))
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.serialize32_byte_bv
val serialize32_byte_bv (n: nat{n < 4294967296}) : Tot (serializer32 (serialize_byte_bv n))
val serialize32_byte_bv (n: nat{n < 4294967296}) : Tot (serializer32 (serialize_byte_bv n))
let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) ()
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 8, "end_line": 57, "start_col": 0, "start_line": 44 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Prims.nat{n < 4294967296} -> LowParse.SLow.Base.serializer32 (LowParse.Spec.BitVector.serialize_byte_bv n)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThan", "Prims.op_Equality", "Prims.int", "LowParse.SLow.Combinators.serialize32_ret", "FStar.BitVector.bv_t", "FStar.Seq.Base.empty", "Prims.bool", "Prims._assert", "FStar.Seq.Base.equal", "Prims.unit", "LowParse.SLow.Combinators.serialize32_synth", "LowParse.Spec.Combinators.and_then_kind", "LowParse.Spec.BitVector.parse_bv8_kind", "LowParse.Spec.BitVector.parse_byte_bv_kind", "Prims.op_Subtraction", "FStar.Pervasives.Native.tuple2", "FStar.Mul.op_Star", "Prims.op_Addition", "LowParse.Spec.Combinators.nondep_then", "LowParse.Spec.BitVector.parse_bv8", "LowParse.Spec.BitVector.parse_byte_bv", "LowParse.Spec.BitVector.synth_byte_bv", "LowParse.Spec.Combinators.serialize_nondep_then", "LowParse.Spec.BitVector.serialize_bv8", "LowParse.Spec.BitVector.serialize_byte_bv", "LowParse.SLow.Combinators.serialize32_nondep_then", "LowParse.SLow.BitVector.serialize32_bv8", "LowParse.SLow.BitVector.serialize32_byte_bv", "LowParse.Spec.BitVector.synth_byte_bv_recip", "Prims.eq2", "LowParse.SLow.Base.serializer32", "LowParse.Spec.BitVector.parse_byte_bv_kind_eq" ]
[ "recursion" ]
false
false
false
false
false
let rec serialize32_byte_bv (n: nat{n < 4294967296}) : Tot (serializer32 (serialize_byte_bv n)) =
parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` (serialize32_byte_bv (n - 1))) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) ()
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mul_by_pow2
val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n)
val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n)
let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 60, "start_col": 0, "start_line": 47 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
len: Lib.IntTypes.size_nat -> n: Hacl.Spec.Bignum.Definitions.lbignum t len -> b: Hacl.Spec.Bignum.Definitions.lbignum t len -> k: Prims.nat -> FStar.Pervasives.Lemma (requires 0 < Hacl.Spec.Bignum.Definitions.bn_v n /\ Hacl.Spec.Bignum.Definitions.bn_v b < Hacl.Spec.Bignum.Definitions.bn_v n) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Lib.LoopCombinators.repeati k (Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n n) b) == Prims.pow2 k * Hacl.Spec.Bignum.Definitions.bn_v b % Hacl.Spec.Bignum.Definitions.bn_v n)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Hacl.Spec.Bignum.Definitions.lbignum", "Prims.nat", "Prims.op_Equality", "Prims.int", "Lib.LoopCombinators.eq_repeati0", "Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n", "Prims.bool", "FStar.Math.Lemmas.pow2_plus", "Prims.op_Subtraction", "Prims.unit", "Prims._assert", "Prims.eq2", "Hacl.Spec.Bignum.Definitions.bn_v", "Prims.op_Modulus", "FStar.Mul.op_Star", "Prims.pow2", "FStar.Math.Lemmas.lemma_mod_mul_distr_r", "Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n_lemma", "Lib.LoopCombinators.unfold_repeati", "Hacl.Spec.Bignum.Montgomery.bn_mul_by_pow2", "Lib.LoopCombinators.repeati" ]
[ "recursion" ]
false
false
true
false
false
let rec bn_mul_by_pow2 #t len n b k =
if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == (2 * pow2 (k - 1)) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fadd_stdcall
val va_wpProof_Fadd_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fadd_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fadd_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fadd_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2462, "start_col": 0, "start_line": 2444 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_stackTaint", "Vale.X64.Decls.va_update_stack", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fadd_stdcall", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd_stdcall" ]
[]
false
false
false
false
false
let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0) )))))))))))))) )))))))); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.merge
val merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2))
val merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2))
let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 53, "end_line": 342, "start_col": 0, "start_line": 338 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a1: Steel.ST.HigherArray.array elt -> a2: FStar.Ghost.erased (Steel.ST.HigherArray.array elt) -> Prims.Pure (Steel.ST.HigherArray.array elt)
Prims.Pure
[]
[]
[ "Steel.ST.HigherArray.array", "FStar.Ghost.erased", "Prims.Mkdtuple2", "Steel.ST.HigherArray.ptr", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.ptr_of", "FStar.Ghost.hide", "Steel.ST.HigherArray.length", "Steel.ST.HigherArray.adjacent", "Prims.eq2", "Prims.int" ]
[]
false
false
false
false
false
let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) =
(| ptr_of a1, Ghost.hide (length a1 + length a2) |)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r
val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen
val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen
let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 9, "end_line": 126, "start_col": 0, "start_line": 123 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> c: Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen) -> Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Base.carry", "FStar.Pervasives.Native.Mktuple2", "Prims.op_Subtraction", "Hacl.Spec.Bignum.bn_rshift", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_t", "Lib.LoopCombinators.repeat_gen", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f", "Lib.IntTypes.uint", "Lib.IntTypes.SEC" ]
[]
false
false
false
false
false
let bn_mont_reduction_loop_div_r #t #nLen n mu c =
let c0, c = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_check_modulus
val bn_check_modulus: #t:limb_t -> #nLen:size_pos{2 * bits t * nLen <= max_size_t} -> n:lbignum t nLen -> res:limb t{v res == (if (bn_v n % 2 = 1 && 1 < bn_v n) then v (ones t SEC) else v (zeros t SEC))}
val bn_check_modulus: #t:limb_t -> #nLen:size_pos{2 * bits t * nLen <= max_size_t} -> n:lbignum t nLen -> res:limb t{v res == (if (bn_v n % 2 = 1 && 1 < bn_v n) then v (ones t SEC) else v (zeros t SEC))}
let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 3, "end_line": 32, "start_col": 0, "start_line": 17 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0"
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> res: Hacl.Spec.Bignum.Definitions.limb t { Lib.IntTypes.v res == (match Hacl.Spec.Bignum.Definitions.bn_v n % 2 = 1 && 1 < Hacl.Spec.Bignum.Definitions.bn_v n with | true -> Lib.IntTypes.v (Lib.IntTypes.ones t Lib.IntTypes.SEC) | _ -> Lib.IntTypes.v (Lib.IntTypes.zeros t Lib.IntTypes.SEC)) }
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.bits", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Prims.unit", "Prims._assert", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Prims.op_AmpAmp", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Hacl.Spec.Bignum.Definitions.bn_v", "Prims.op_LessThan", "Lib.IntTypes.ones", "Prims.bool", "Lib.IntTypes.zeros", "Lib.IntTypes.logand_lemma", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Amp_Dot", "Hacl.Spec.Bignum.bn_lt_mask_lemma", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.bn_lt_mask", "Lib.IntTypes.op_Subtraction_Dot", "Lib.IntTypes.uint", "Hacl.Spec.Bignum.bn_is_odd_lemma", "Hacl.Spec.Bignum.bn_is_odd", "Hacl.Spec.Bignum.bn_from_uint_lemma", "Hacl.Spec.Bignum.bn_from_uint" ]
[]
false
false
false
false
false
let bn_check_modulus #t #nLen n =
let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction
val bn_mont_reduction: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> lbignum t nLen
val bn_mont_reduction: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> lbignum t nLen
let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 131, "start_col": 0, "start_line": 129 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> c: Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen) -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Base.carry", "Hacl.Spec.Bignum.bn_reduce_once", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r" ]
[]
false
false
false
false
false
let bn_mont_reduction #t #nLen n mu c =
let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.is_null
val is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null))
val is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null))
let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 24, "end_line": 97, "start_col": 0, "start_line": 94 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p: Steel.ST.HigherArray.array a -> Prims.Pure Prims.bool
Prims.Pure
[]
[]
[ "Steel.ST.HigherArray.array", "Steel.ST.HigherArray.is_null_ptr", "Steel.ST.HigherArray.ptr_of", "Prims.bool", "Prims.l_True", "Prims.l_iff", "Prims.eq2", "Steel.ST.HigherArray.null" ]
[]
false
false
false
false
false
let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) =
is_null_ptr (ptr_of p)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_precomp_r2_mod_n_lemma
val bn_precomp_r2_mod_n_lemma: #t:limb_t -> #nLen:size_pos -> nBits:size_nat -> n:lbignum t nLen -> Lemma (requires 1 < bn_v n /\ bn_v n % 2 = 1 /\ 2 * bits t * nLen <= max_size_t /\ pow2 nBits < bn_v n /\ nBits / bits t < nLen) (ensures bn_v (bn_precomp_r2_mod_n nBits n) == pow2 (2 * bits t * nLen) % bn_v n)
val bn_precomp_r2_mod_n_lemma: #t:limb_t -> #nLen:size_pos -> nBits:size_nat -> n:lbignum t nLen -> Lemma (requires 1 < bn_v n /\ bn_v n % 2 = 1 /\ 2 * bits t * nLen <= max_size_t /\ pow2 nBits < bn_v n /\ nBits / bits t < nLen) (ensures bn_v (bn_precomp_r2_mod_n nBits n) == pow2 (2 * bits t * nLen) % bn_v n)
let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n)
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 56, "end_line": 81, "start_col": 0, "start_line": 71 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
nBits: Lib.IntTypes.size_nat -> n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires 1 < Hacl.Spec.Bignum.Definitions.bn_v n /\ Hacl.Spec.Bignum.Definitions.bn_v n % 2 = 1 /\ (2 * Lib.IntTypes.bits t) * nLen <= Lib.IntTypes.max_size_t /\ Prims.pow2 nBits < Hacl.Spec.Bignum.Definitions.bn_v n /\ nBits / Lib.IntTypes.bits t < nLen ) (ensures Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_precomp_r2_mod_n nBits n) == Prims.pow2 ((2 * Lib.IntTypes.bits t) * nLen) % Hacl.Spec.Bignum.Definitions.bn_v n)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Lib.IntTypes.size_nat", "Hacl.Spec.Bignum.Definitions.lbignum", "Prims._assert", "Prims.eq2", "Prims.int", "Hacl.Spec.Bignum.Definitions.bn_v", "Prims.op_Modulus", "Prims.pow2", "FStar.Mul.op_Star", "Lib.IntTypes.bits", "Prims.unit", "FStar.Math.Lemmas.pow2_plus", "Prims.op_Subtraction", "Hacl.Spec.Bignum.Montgomery.bn_mul_by_pow2", "Lib.LoopCombinators.repeati", "Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n", "Prims.l_or", "Prims.b2t", "Prims.op_GreaterThanOrEqual", "Prims.op_GreaterThan", "Hacl.Spec.Bignum.bn_set_ith_bit_lemma", "Hacl.Spec.Bignum.Definitions.bn_eval_zeroes", "Hacl.Spec.Bignum.bn_set_ith_bit", "Lib.Sequence.lseq", "Hacl.Spec.Bignum.Definitions.limb", "Prims.l_and", "FStar.Seq.Base.seq", "Lib.Sequence.to_seq", "FStar.Seq.Base.create", "Lib.IntTypes.mk_int", "Lib.IntTypes.SEC", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Prims.op_LessThan", "Lib.Sequence.index", "Lib.Sequence.create", "Lib.IntTypes.uint" ]
[]
true
false
true
false
false
let bn_precomp_r2_mod_n_lemma #t #nLen nBits n =
let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati ((2 * bits t) * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 ((2 * bits t) * nLen - nBits); assert (bn_v res == pow2 ((2 * bits t) * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus ((2 * bits t) * nLen - nBits) nBits; assert (bn_v res == pow2 ((2 * bits t) * nLen) % bn_v n)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fmul1_stdcall
val va_qcode_Fmul1_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win))
val va_qcode_Fmul1_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win))
let va_qcode_Fmul1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1233 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1234 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1235 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1240 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1241 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1242 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1243 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1246 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fmul1 dst_b inA_b inB_in) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1248 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1250 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1253 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1254 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1255 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 81, "end_line": 2921, "start_col": 0, "start_line": 2884 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Fmul1_stdcall #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1_stdcall win = (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1_stdcall win = (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ())))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fmul1 ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ()))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_in: Vale.X64.Memory.nat64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fmul1_stdcall win)
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsStack.va_code_Push_Secret", "Vale.X64.Decls.va_op_reg_opr64_reg64", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.QuickCodes.if_code", "Vale.X64.QuickCodes.block", "Vale.X64.Machine_s.rRsi", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Decls.va_op_opr64_reg64", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rR8", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1", "Vale.X64.InsStack.va_code_Pop_Secret", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsStack.va_quick_Push_Secret", "Vale.X64.QuickCodes.va_QBind", "Vale.X64.QuickCodes.va_qInlineIf", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.X64.QuickCodes.va_QEmpty", "Vale.X64.QuickCodes.quickCodes", "Vale.Curve25519.X64.FastHybrid.va_quick_Fmul1", "Vale.X64.InsStack.va_quick_Pop_Secret", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.Def.Types_s.nat64", "Prims.b2t", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1_stdcall" ]
[]
false
false
false
false
false
let va_qcode_Fmul1_stdcall (va_mods: va_mods_t) (win: bool) (dst_b inA_b: buffer64) (inB_in: nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win)) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1233 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1234 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1235 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (fun (va_s: va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1240 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1241 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1242 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1243 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1246 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fmul1 dst_b inA_b inB_in) (fun (va_s: va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1248 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s: va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1250 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QEmpty (())))) (qblock va_mods (fun (va_s: va_state) -> va_QEmpty (())))) (fun (va_s: va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1253 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1254 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1255 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))))))))))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_precomp_r2_mod_n
val bn_precomp_r2_mod_n: #t:limb_t -> #nLen:size_pos{2 * bits t * nLen <= max_size_t} -> nBits:size_nat{nBits / bits t < nLen} -> n:lbignum t nLen -> lbignum t nLen
val bn_precomp_r2_mod_n: #t:limb_t -> #nLen:size_pos{2 * bits t * nLen <= max_size_t} -> nBits:size_nat{nBits / bits t < nLen} -> n:lbignum t nLen -> lbignum t nLen
let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 67, "end_line": 68, "start_col": 0, "start_line": 63 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
nBits: Lib.IntTypes.size_nat{nBits / Lib.IntTypes.bits t < nLen} -> n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.bits", "Lib.IntTypes.max_size_t", "Lib.IntTypes.size_nat", "Prims.op_LessThan", "Prims.op_Division", "Hacl.Spec.Bignum.Definitions.lbignum", "Lib.LoopCombinators.repeati", "Prims.op_Subtraction", "Hacl.Spec.Bignum.Montgomery.bn_lshift1_mod_n", "Hacl.Spec.Bignum.bn_set_ith_bit", "Lib.Sequence.lseq", "Hacl.Spec.Bignum.Definitions.limb", "Prims.l_and", "Prims.eq2", "FStar.Seq.Base.seq", "Lib.Sequence.to_seq", "FStar.Seq.Base.create", "Lib.IntTypes.mk_int", "Lib.IntTypes.SEC", "Prims.l_Forall", "Prims.nat", "Prims.l_imp", "Lib.Sequence.index", "Lib.Sequence.create", "Lib.IntTypes.uint" ]
[]
false
false
false
false
false
let bn_precomp_r2_mod_n #t #nLen nBits n =
let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in Loops.repeati ((2 * bits t) * nLen - nBits) (bn_lshift1_mod_n n) c0
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_qcode_Fmul1
val va_qcode_Fmul1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64) : (va_quickCode unit (va_code_Fmul1 ()))
val va_qcode_Fmul1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64) : (va_quickCode unit (va_code_Fmul1 ()))
let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 60, "end_line": 2793, "start_col": 0, "start_line": 2757 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_mods: Vale.X64.QuickCode.va_mods_t -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB: Vale.X64.Memory.nat64 -> Vale.X64.QuickCode.va_quickCode Prims.unit (Vale.Curve25519.X64.FastHybrid.va_code_Fmul1 ())
Prims.Tot
[ "total" ]
[]
[ "Vale.X64.QuickCode.va_mods_t", "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.QuickCodes.qblock", "Prims.unit", "Prims.Cons", "Vale.X64.Decls.va_code", "Vale.X64.InsMem.va_code_CreateHeaplets", "Vale.Curve25519.X64.FastHybrid.va_code_Fast_mul1", "Vale.X64.InsBasic.va_code_LargeComment", "Vale.X64.InsBasic.va_code_Comment", "Vale.X64.InsBasic.va_code_Mov64", "Vale.X64.Decls.va_op_dst_opr64_reg64", "Vale.X64.Machine_s.rRdx", "Vale.X64.Decls.va_const_opr64", "Vale.Curve25519.X64.FastHybrid.va_code_Carry_pass", "Vale.X64.InsMem.va_code_DestroyHeaplets", "Prims.Nil", "Vale.X64.Machine_s.precode", "Vale.X64.Decls.ins", "Vale.X64.Decls.ocmp", "Vale.X64.Decls.va_state", "Vale.X64.QuickCodes.va_QSeq", "Vale.X64.QuickCodes.va_range1", "Vale.X64.InsMem.va_quick_CreateHeaplets", "Vale.Arch.HeapImpl.buffer_info", "Vale.X64.InsMem.declare_buffer64", "Vale.Arch.HeapTypes_s.Secret", "Vale.Arch.HeapImpl.Immutable", "Vale.Arch.HeapImpl.Mutable", "Vale.X64.QuickCodes.va_QBind", "Vale.Curve25519.X64.FastHybrid.va_quick_Fast_mul1", "Vale.X64.QuickCodes.va_qPURE", "Prims.pure_post", "Prims.l_and", "Prims.eq2", "Prims.int", "Vale.Curve25519.Fast_defs.pow2_five", "Prims.op_Multiply", "Vale.Curve25519.Fast_defs.pow2_four", "Prims.b2t", "Prims.op_LessThan", "Prims.l_Forall", "Prims.l_imp", "Vale.Curve25519.FastHybrid_helpers.lemma_fmul", "Vale.X64.QuickCodes.va_qAssert", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Machine_s.rRax", "Vale.Curve25519.FastHybrid_helpers.pow2_63", "Vale.X64.InsBasic.va_quick_LargeComment", "Vale.X64.InsBasic.va_quick_Comment", "Vale.X64.InsBasic.va_quick_Mov64", "Vale.Curve25519.X64.FastHybrid.va_quick_Carry_pass", "Vale.X64.InsMem.va_quick_DestroyHeaplets", "Vale.X64.QuickCodes.va_QEmpty", "Vale.Def.Words_s.nat64", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR11", "Vale.X64.QuickCodes.quickCodes", "Prims.nat", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_get_mem", "Vale.X64.State.vale_state", "Vale.X64.QuickCode.va_quickCode", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1" ]
[]
false
false
false
false
false
let va_qcode_Fmul1 (va_mods: va_mods_t) (dst_b inA_b: buffer64) (inB: nat64) : (va_quickCode unit (va_code_Fmul1 ())) =
(qblock va_mods (fun (va_s: va_state) -> let va_old_s:va_state = va_s in let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([ declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable ])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s: va_state) _ -> let va_arg28:Vale.Def.Types_s.nat64 = va_get_reg64 rRax va_s in let va_arg27:Vale.Def.Types_s.nat64 = va_get_reg64 rR11 va_s in let va_arg26:Vale.Def.Types_s.nat64 = va_get_reg64 rR10 va_s in let va_arg25:Vale.Def.Types_s.nat64 = va_get_reg64 rR9 va_s in let va_arg24:Vale.Def.Types_s.nat64 = va_get_reg64 rR8 va_s in let va_arg23:Vale.Def.Types_s.nat64 = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_: unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" ((va_get_reg64 rRax va_s) `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field") (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38") (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38) ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fmul1
val va_lemma_Fmul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fmul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ va_get_reg64 rRdx va_s0 == inB /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdx va_s0 < 131072))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))
val va_lemma_Fmul1 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB:nat64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fmul1 ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ va_get_reg64 rRdx va_s0 == inB /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRdx va_s0 < 131072))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))
let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2831, "start_col": 0, "start_line": 2798 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB: Vale.X64.Memory.nat64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Vale.X64.Decls.va_mul_nat", "Vale.X64.Decls.va_get_reg64", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fmul1" ]
[]
false
false
false
false
false
let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (va_mul_nat a (va_get_reg64 rRdx va_s0)) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f
val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen))
val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen))
let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 9, "end_line": 109, "start_col": 0, "start_line": 104 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> j: Lib.IntTypes.size_nat{j < nLen} -> _: (Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen)) -> Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen)
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Prims.op_LessThan", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.Base.carry", "FStar.Pervasives.Native.Mktuple2", "Lib.Sequence.lseq", "Prims.l_and", "Prims.eq2", "FStar.Seq.Base.seq", "Lib.Sequence.to_seq", "FStar.Seq.Base.upd", "Lib.Sequence.index", "Prims.l_Forall", "Prims.nat", "Prims.op_Subtraction", "Prims.pow2", "Prims.l_imp", "Prims.op_disEquality", "Prims.l_or", "FStar.Seq.Base.index", "Lib.Sequence.op_String_Assignment", "Hacl.Spec.Bignum.Base.addcarry", "Lib.Sequence.op_String_Access", "Hacl.Spec.Bignum.bn_mul1_lshift_add", "Lib.IntTypes.int_t", "Lib.IntTypes.SEC", "Lib.IntTypes.op_Star_Dot" ]
[]
false
false
false
false
false
let bn_mont_reduction_f #t #nLen n mu j (c0, acc) =
let qj = mu *. acc.[ j ] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[ nLen + j ] in let res = res1.[ nLen + j ] <- r in c2, res
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.split_l
val split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True))
val split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True))
let split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True)) = (| ptr_of a, Ghost.hide (US.v i) |)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 37, "end_line": 412, "start_col": 0, "start_line": 407 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction [@@noextract_to "krml"] let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |) /// Adjacency and merging are associative. let merge_assoc (#elt: Type) (a1 a2 a3: array elt) : Lemma (requires ( (adjacent a1 a2 /\ adjacent a2 a3) \/ (adjacent a1 a2 /\ adjacent (merge a1 a2) a3) \/ (adjacent a2 a3 /\ adjacent a1 (merge a2 a3)) )) (ensures ( adjacent (merge a1 a2) a3 /\ adjacent a1 (merge a2 a3) /\ merge (merge a1 a2) a3 == merge a1 (merge a2 a3) )) = () /// A shortcut to combine adjacency and merging let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop = adjacent a1 a2 /\ merge a1 a2 == a /// Spatial merging of two arrays, expressed in terms of `merge`. val ghost_join (#opened: _) (#elt: Type) (#x1 #x2: Seq.seq elt) (#p: P.perm) (a1 a2: array elt) (h: squash (adjacent a1 a2)) : STGhostT unit opened (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to (merge a1 a2) p (x1 `Seq.append` x2)) /// Spatial merging, combining the use of `merge` and the call to the /// stateful lemma. Since the only operations are calls to stateful /// lemmas and pure computations, the overall computation is atomic /// and unobservable, so can be used anywhere in atomic contexts. By /// virtue of the length being ghost, Karamel will extract this to /// "let res = a1" inline_for_extraction // this will extract to "let res = a1" [@@noextract_to "krml"] let join (#opened: _) (#elt: Type) (#x1 #x2: Ghost.erased (Seq.seq elt)) (#p: P.perm) (a1: array elt) (a2: Ghost.erased (array elt)) : STAtomicBase (array elt) false opened Unobservable (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to res p (x1 `Seq.append` x2)) (adjacent a1 a2) (fun res -> merge_into a1 a2 res) = let _ : squash (adjacent a1 a2) = () in ghost_join a1 a2 (); let res = merge a1 a2 in rewrite (pts_to (merge a1 (Ghost.hide (Ghost.reveal a2))) p (x1 `Seq.append` x2)) (pts_to res p (x1 `Seq.append` x2)); return res /// Computing the left-hand-side part of splitting an array a at /// offset i. By virtue of the length being ghost, Karamel will /// extract this to "let y = a" inline_for_extraction // this will extract to "let y = a"
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Steel.ST.HigherArray.array elt -> i: FStar.Ghost.erased FStar.SizeT.t -> Prims.Pure (Steel.ST.HigherArray.array elt)
Prims.Pure
[]
[]
[ "Steel.ST.HigherArray.array", "FStar.Ghost.erased", "FStar.SizeT.t", "Prims.Mkdtuple2", "Steel.ST.HigherArray.ptr", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.ptr_of", "FStar.Ghost.hide", "FStar.SizeT.v", "Steel.ST.HigherArray.length", "Prims.l_True" ]
[]
false
false
false
false
false
let split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True)) =
(| ptr_of a, Ghost.hide (US.v i) |)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_one
val bn_mont_one: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> lbignum t nLen
val bn_mont_one: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> lbignum t nLen
let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 151, "start_col": 0, "start_line": 150 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> r2: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_from_mont" ]
[]
false
false
false
false
false
let bn_mont_one #t #nLen n mu r2 =
bn_from_mont n mu r2
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_precomp
val bn_mont_precomp: #t:limb_t -> #nLen:size_pos -> nBits:size_nat -> n:lbignum t nLen -> Pure (tuple2 (lbignum t nLen) (limb t)) (requires 1 < bn_v n /\ bn_v n % 2 = 1 /\ 2 * bits t * nLen <= max_size_t /\ pow2 nBits < bn_v n /\ nBits / bits t < nLen) (ensures fun (r2, mu) -> bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n)
val bn_mont_precomp: #t:limb_t -> #nLen:size_pos -> nBits:size_nat -> n:lbignum t nLen -> Pure (tuple2 (lbignum t nLen) (limb t)) (requires 1 < bn_v n /\ bn_v n % 2 = 1 /\ 2 * bits t * nLen <= max_size_t /\ pow2 nBits < bn_v n /\ nBits / bits t < nLen) (ensures fun (r2, mu) -> bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n)
let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 8, "end_line": 90, "start_col": 0, "start_line": 84 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
nBits: Lib.IntTypes.size_nat -> n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Prims.Pure (Hacl.Spec.Bignum.Definitions.lbignum t nLen * Hacl.Spec.Bignum.Definitions.limb t)
Prims.Pure
[]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Lib.IntTypes.size_nat", "Hacl.Spec.Bignum.Definitions.lbignum", "FStar.Pervasives.Native.Mktuple2", "Hacl.Spec.Bignum.Definitions.limb", "Prims.unit", "Hacl.Spec.Bignum.Definitions.bn_eval_bound", "Hacl.Spec.Bignum.ModInvLimb.bn_mod_inv_limb_lemma", "Hacl.Spec.Bignum.ModInvLimb.mod_inv_limb", "Lib.Sequence.op_String_Access", "Hacl.Spec.Bignum.Montgomery.bn_precomp_r2_mod_n_lemma", "Hacl.Spec.Bignum.Montgomery.bn_precomp_r2_mod_n", "FStar.Pervasives.Native.tuple2" ]
[]
false
false
false
false
false
let bn_mont_precomp #t #nLen nBits n =
let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[ 0 ] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_mul
val bn_mont_mul: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> lbignum t nLen
val bn_mont_mul: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> lbignum t nLen
let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 26, "end_line": 144, "start_col": 0, "start_line": 142 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> bM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Hacl.Spec.Bignum.bn_mul" ]
[]
false
false
false
false
false
let bn_mont_mul #t #nLen n mu aM bM =
let c = BN.bn_mul aM bM in bn_mont_reduction n mu c
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.blit_post
val blit_post (#t: _) (s0 s1: Ghost.erased (Seq.seq t)) (src: array t) (idx_src: US.t) (dst: array t) (idx_dst len: US.t) (s1': Seq.seq t) : Tot prop
val blit_post (#t: _) (s0 s1: Ghost.erased (Seq.seq t)) (src: array t) (idx_src: US.t) (dst: array t) (idx_dst len: US.t) (s1': Seq.seq t) : Tot prop
let blit_post (#t:_) (s0 s1:Ghost.erased (Seq.seq t)) (src:array t) (idx_src: US.t) (dst:array t) (idx_dst: US.t) (len: US.t) (s1' : Seq.seq t) : Tot prop = US.v idx_src + US.v len <= length src /\ US.v idx_dst + US.v len <= length dst /\ length src == Seq.length s0 /\ length dst == Seq.length s1 /\ Seq.length s1' == Seq.length s1 /\ Seq.slice s1' (US.v idx_dst) (US.v idx_dst + US.v len) `Seq.equal` Seq.slice s0 (US.v idx_src) (US.v idx_src + US.v len) /\ Seq.slice s1' 0 (US.v idx_dst) `Seq.equal` Seq.slice s1 0 (US.v idx_dst) /\ Seq.slice s1' (US.v idx_dst + US.v len) (length dst) `Seq.equal` Seq.slice s1 (US.v idx_dst + US.v len) (length dst)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 61, "end_line": 496, "start_col": 0, "start_line": 476 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction [@@noextract_to "krml"] let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |) /// Adjacency and merging are associative. let merge_assoc (#elt: Type) (a1 a2 a3: array elt) : Lemma (requires ( (adjacent a1 a2 /\ adjacent a2 a3) \/ (adjacent a1 a2 /\ adjacent (merge a1 a2) a3) \/ (adjacent a2 a3 /\ adjacent a1 (merge a2 a3)) )) (ensures ( adjacent (merge a1 a2) a3 /\ adjacent a1 (merge a2 a3) /\ merge (merge a1 a2) a3 == merge a1 (merge a2 a3) )) = () /// A shortcut to combine adjacency and merging let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop = adjacent a1 a2 /\ merge a1 a2 == a /// Spatial merging of two arrays, expressed in terms of `merge`. val ghost_join (#opened: _) (#elt: Type) (#x1 #x2: Seq.seq elt) (#p: P.perm) (a1 a2: array elt) (h: squash (adjacent a1 a2)) : STGhostT unit opened (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to (merge a1 a2) p (x1 `Seq.append` x2)) /// Spatial merging, combining the use of `merge` and the call to the /// stateful lemma. Since the only operations are calls to stateful /// lemmas and pure computations, the overall computation is atomic /// and unobservable, so can be used anywhere in atomic contexts. By /// virtue of the length being ghost, Karamel will extract this to /// "let res = a1" inline_for_extraction // this will extract to "let res = a1" [@@noextract_to "krml"] let join (#opened: _) (#elt: Type) (#x1 #x2: Ghost.erased (Seq.seq elt)) (#p: P.perm) (a1: array elt) (a2: Ghost.erased (array elt)) : STAtomicBase (array elt) false opened Unobservable (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to res p (x1 `Seq.append` x2)) (adjacent a1 a2) (fun res -> merge_into a1 a2 res) = let _ : squash (adjacent a1 a2) = () in ghost_join a1 a2 (); let res = merge a1 a2 in rewrite (pts_to (merge a1 (Ghost.hide (Ghost.reveal a2))) p (x1 `Seq.append` x2)) (pts_to res p (x1 `Seq.append` x2)); return res /// Computing the left-hand-side part of splitting an array a at /// offset i. By virtue of the length being ghost, Karamel will /// extract this to "let y = a" inline_for_extraction // this will extract to "let y = a" [@@noextract_to "krml"] let split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True)) = (| ptr_of a, Ghost.hide (US.v i) |) /// C pointer arithmetic to compute (p+off), shifting a pointer p by /// offset off. TODO: replace this with a Ghost definition and a /// STAtomicBase Unobservable operation with the corresponding /// permission. [@@noextract_to "krml"] // primitive val ptr_shift (#elt: Type) (p: ptr elt) (off: US.t) : Pure (ptr elt) (requires (offset p + US.v off <= base_len (base p))) (ensures (fun p' -> base p' == base p /\ offset p' == offset p + US.v off )) let ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p) = ptr_base_offset_inj (ptr_shift p 0sz) p /// Computing the right-hand-side part of splitting an array a at /// offset i. inline_for_extraction [@@noextract_to "krml"] let split_r (#elt: Type) (a: array elt) (i: US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> merge_into (split_l a i) y a)) = (| ptr_shift (ptr_of a) i, Ghost.hide (length a - US.v i) |) /// Splitting an array a at offset i, as a stateful lemma expressed in /// terms of split_l, split_r. This stateful lemma returns a proof /// that offset i is in bounds of the value sequence, which is needed to /// typecheck the post-resource. val ghost_split (#opened: _) (#elt: Type) (#x: Seq.seq elt) (#p: P.perm) (a: array elt) (i: US.t) : STGhost (squash (US.v i <= length a /\ US.v i <= Seq.length x)) opened (pts_to a p x) (fun res -> pts_to (split_l a i) p (Seq.slice x 0 (US.v i)) `star` pts_to (split_r a i) p (Seq.slice x (US.v i) (Seq.length x))) (US.v i <= length a) (fun res -> x == Seq.append (Seq.slice x 0 (US.v i)) (Seq.slice x (US.v i) (Seq.length x)) ) /// NOTE: we could implement a STAtomicBase Unobservable "split" /// operation, just like "join", but we don't want it to return a pair /// of arrays. For now we settle on explicit use of split_l, split_r. /// Copies the contents of a0 to a1
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
s0: FStar.Ghost.erased (FStar.Seq.Base.seq t) -> s1: FStar.Ghost.erased (FStar.Seq.Base.seq t) -> src: Steel.ST.HigherArray.array t -> idx_src: FStar.SizeT.t -> dst: Steel.ST.HigherArray.array t -> idx_dst: FStar.SizeT.t -> len: FStar.SizeT.t -> s1': FStar.Seq.Base.seq t -> Prims.prop
Prims.Tot
[ "total" ]
[]
[ "FStar.Ghost.erased", "FStar.Seq.Base.seq", "Steel.ST.HigherArray.array", "FStar.SizeT.t", "Prims.l_and", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "FStar.SizeT.v", "Steel.ST.HigherArray.length", "Prims.eq2", "Prims.nat", "FStar.Seq.Base.length", "FStar.Ghost.reveal", "FStar.Seq.Base.equal", "FStar.Seq.Base.slice", "Prims.prop" ]
[]
false
false
false
true
true
let blit_post (#t: _) (s0 s1: Ghost.erased (Seq.seq t)) (src: array t) (idx_src: US.t) (dst: array t) (idx_dst len: US.t) (s1': Seq.seq t) : Tot prop =
US.v idx_src + US.v len <= length src /\ US.v idx_dst + US.v len <= length dst /\ length src == Seq.length s0 /\ length dst == Seq.length s1 /\ Seq.length s1' == Seq.length s1 /\ (Seq.slice s1' (US.v idx_dst) (US.v idx_dst + US.v len)) `Seq.equal` (Seq.slice s0 (US.v idx_src) (US.v idx_src + US.v len)) /\ (Seq.slice s1' 0 (US.v idx_dst)) `Seq.equal` (Seq.slice s1 0 (US.v idx_dst)) /\ (Seq.slice s1' (US.v idx_dst + US.v len) (length dst)) `Seq.equal` (Seq.slice s1 (US.v idx_dst + US.v len) (length dst))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_to_mont
val bn_to_mont: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> a:lbignum t nLen -> lbignum t nLen
val bn_to_mont: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> a:lbignum t nLen -> lbignum t nLen
let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 26, "end_line": 135, "start_col": 0, "start_line": 133 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> r2: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> a: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Hacl.Spec.Bignum.bn_mul" ]
[]
false
false
false
false
false
let bn_to_mont #t #nLen n mu r2 a =
let c = BN.bn_mul a r2 in bn_mont_reduction n mu c
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_sqr
val bn_mont_sqr: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
val bn_mont_sqr: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 26, "end_line": 148, "start_col": 0, "start_line": 146 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Hacl.Spec.Bignum.bn_mul" ]
[]
false
false
false
false
false
let bn_mont_sqr #t #nLen n mu aM =
let c = BN.bn_mul aM aM in bn_mont_reduction n mu c
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fadd_stdcall
val va_lemma_Fadd_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fadd_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inB_in inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a + b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
val va_lemma_Fadd_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fadd_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inB_in inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a + b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2440, "start_col": 0, "start_line": 2357 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fadd_stdcall", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Prims.op_Addition", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.l_imp", "Vale.Def.Types_s.nat64", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fadd_stdcall" ]
[]
false
false
false
false
false
let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let inB_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))) ))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.ptr_shift_zero
val ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p)
val ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p)
let ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p) = ptr_base_offset_inj (ptr_shift p 0sz) p
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 41, "end_line": 435, "start_col": 0, "start_line": 430 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction [@@noextract_to "krml"] let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |) /// Adjacency and merging are associative. let merge_assoc (#elt: Type) (a1 a2 a3: array elt) : Lemma (requires ( (adjacent a1 a2 /\ adjacent a2 a3) \/ (adjacent a1 a2 /\ adjacent (merge a1 a2) a3) \/ (adjacent a2 a3 /\ adjacent a1 (merge a2 a3)) )) (ensures ( adjacent (merge a1 a2) a3 /\ adjacent a1 (merge a2 a3) /\ merge (merge a1 a2) a3 == merge a1 (merge a2 a3) )) = () /// A shortcut to combine adjacency and merging let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop = adjacent a1 a2 /\ merge a1 a2 == a /// Spatial merging of two arrays, expressed in terms of `merge`. val ghost_join (#opened: _) (#elt: Type) (#x1 #x2: Seq.seq elt) (#p: P.perm) (a1 a2: array elt) (h: squash (adjacent a1 a2)) : STGhostT unit opened (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to (merge a1 a2) p (x1 `Seq.append` x2)) /// Spatial merging, combining the use of `merge` and the call to the /// stateful lemma. Since the only operations are calls to stateful /// lemmas and pure computations, the overall computation is atomic /// and unobservable, so can be used anywhere in atomic contexts. By /// virtue of the length being ghost, Karamel will extract this to /// "let res = a1" inline_for_extraction // this will extract to "let res = a1" [@@noextract_to "krml"] let join (#opened: _) (#elt: Type) (#x1 #x2: Ghost.erased (Seq.seq elt)) (#p: P.perm) (a1: array elt) (a2: Ghost.erased (array elt)) : STAtomicBase (array elt) false opened Unobservable (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to res p (x1 `Seq.append` x2)) (adjacent a1 a2) (fun res -> merge_into a1 a2 res) = let _ : squash (adjacent a1 a2) = () in ghost_join a1 a2 (); let res = merge a1 a2 in rewrite (pts_to (merge a1 (Ghost.hide (Ghost.reveal a2))) p (x1 `Seq.append` x2)) (pts_to res p (x1 `Seq.append` x2)); return res /// Computing the left-hand-side part of splitting an array a at /// offset i. By virtue of the length being ghost, Karamel will /// extract this to "let y = a" inline_for_extraction // this will extract to "let y = a" [@@noextract_to "krml"] let split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True)) = (| ptr_of a, Ghost.hide (US.v i) |) /// C pointer arithmetic to compute (p+off), shifting a pointer p by /// offset off. TODO: replace this with a Ghost definition and a /// STAtomicBase Unobservable operation with the corresponding /// permission. [@@noextract_to "krml"] // primitive val ptr_shift (#elt: Type) (p: ptr elt) (off: US.t) : Pure (ptr elt) (requires (offset p + US.v off <= base_len (base p))) (ensures (fun p' -> base p' == base p /\ offset p' == offset p + US.v off ))
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
p: Steel.ST.HigherArray.ptr elt -> FStar.Pervasives.Lemma (ensures Steel.ST.HigherArray.ptr_shift p 0sz == p)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Steel.ST.HigherArray.ptr", "Steel.ST.HigherArray.ptr_base_offset_inj", "Steel.ST.HigherArray.ptr_shift", "FStar.SizeT.__uint_to_t", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.eq2", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
true
false
true
false
false
let ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p) =
ptr_base_offset_inj (ptr_shift p 0sz) p
false
Steel.ST.HigherArray.fsti
Steel.ST.HigherArray.split_r
val split_r (#elt: Type) (a: array elt) (i: US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> merge_into (split_l a i) y a))
val split_r (#elt: Type) (a: array elt) (i: US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> merge_into (split_l a i) y a))
let split_r (#elt: Type) (a: array elt) (i: US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> merge_into (split_l a i) y a)) = (| ptr_shift (ptr_of a) i, Ghost.hide (length a - US.v i) |)
{ "file_name": "lib/steel/Steel.ST.HigherArray.fsti", "git_rev": "f984200f79bdc452374ae994a5ca837496476c41", "git_url": "https://github.com/FStarLang/steel.git", "project_name": "steel" }
{ "end_col": 62, "end_line": 446, "start_col": 0, "start_line": 441 }
(* Copyright 2022 Microsoft Research 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. *) module Steel.ST.HigherArray /// C arrays of universe 1 elements. /// /// - Due to a limitation on the universe for selectors, no selector /// version can be defined for universe 1. /// - Due to F* universes not being cumulative, arrays of universe 0 /// elements need to be defined in a separate module. module P = Steel.FractionalPermission module US = FStar.SizeT module UP = FStar.PtrdiffT open Steel.ST.Util /// NOTE: This module is slated to have primitive Karamel extraction /// (except for definitions meant to be inlined.) /// An abstract type to represent a base array (whole allocation /// unit), exposed for proof purposes only [@@erasable] val base_t (elt: Type u#a) : Tot Type0 val base_len (#elt: Type) (b: base_t elt) : GTot nat /// An abstract type to represent a C pointer, as a base and an offset /// into its base [@@noextract_to "krml"] // primitive val ptr ([@@@unused] elt: Type u#a) : Type0 [@@noextract_to "krml"] val null_ptr (elt: Type u#a) : ptr elt // TODO: turn into a stateful operation to avoid comparing dangling pointers [@@noextract_to "krml"] val is_null_ptr (#elt: Type u#a) (p: ptr elt) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null_ptr elt)) val base (#elt: Type) (p: ptr elt) : Tot (base_t elt) val offset (#elt: Type) (p: ptr elt) : Ghost nat (requires True) (ensures (fun offset -> offset <= base_len (base p))) val ptr_base_offset_inj (#elt: Type) (p1 p2: ptr elt) : Lemma (requires ( base p1 == base p2 /\ offset p1 == offset p2 )) (ensures ( p1 == p2 )) val base_len_null_ptr (elt: Type u#a) : Lemma (base_len (base (null_ptr elt)) == 0) [SMTPat (base_len (base (null_ptr elt)))] /// A concrete type to represent a C array, as a C pointer and a ghost /// array length. By virtue of the length being ghost, Karamel will /// extract this type as just ptr, but to inline the definition of /// this type, we use standard dependent pairs instead of a custom /// record type. inline_for_extraction [@@noextract_to "krml"] let array ([@@@strictly_positive] elt: Type u#a) : Tot Type0 = (p: ptr elt & (length: Ghost.erased nat {offset p + length <= base_len (base p)})) inline_for_extraction [@@noextract_to "krml"] let null (#a: Type u#a) : array a = (| null_ptr a, Ghost.hide 0 |) /// This will extract to "let p = a" inline_for_extraction [@@noextract_to "krml"] let ptr_of (#elt: Type) (a: array elt) : Tot (ptr elt) = match a with // dfst is not marked inline_for_extraction, so we need to reimplement it | (| p, _ |) -> p inline_for_extraction [@@noextract_to "krml"] let is_null (#a: Type u#a) (p: array a) : Pure bool (requires True) (ensures (fun res -> res == true <==> p == null)) = is_null_ptr (ptr_of p) let length (#elt: Type) (a: array elt) : GTot nat = dsnd a val length_fits (#elt: Type) (a: array elt) : Lemma (US.fits (length a)) /// A Steel separation logic heap predicate to describe that an array /// a points to some element sequence s with some permission p. vprop /// limits the universe to at most 1 (because of the universe of the /// heap.) val pts_to (#elt: Type u#1) (a: array elt) (p: P.perm) ([@@@ smt_fallback ] s: Seq.seq elt) : Tot vprop /// A stateful lemma to relate the size of an array with the size /// of the element sequence it points to val pts_to_length (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> Seq.length s == length a) val pts_to_not_null (#opened: _) (#elt: Type u#1) (#p: P.perm) (a: array elt) (s: Seq.seq elt) : STGhost unit opened (pts_to a p s) (fun _ -> pts_to a p s) (True) (fun _ -> a =!= null) /// An injectivity property, needed only to define a selector. Such a /// selector can be only defined in universe 0, and universes are not /// cumulative, so we need to define a separate module for arrays of /// universe 0 elements with selectors, reusing definitions from this /// interface, but we do not want to use `friend`. val pts_to_inj (#elt: Type u#1) (a: array elt) (p1: P.perm) (s1: Seq.seq elt) (p2: P.perm) (s2: Seq.seq elt) (m: mem) : Lemma (requires ( interp (hp_of (pts_to a p1 s1)) m /\ interp (hp_of (pts_to a p2 s2)) m )) (ensures ( s1 == s2 )) /// Allocating a new array of size n, where each cell is initialized /// with value x. We expose a pointer version for extraction purposes [@@noextract_to "krml"] // primitive val malloc_ptr (#elt: Type) (x: elt) (n: US.t) : STT(a: ptr elt { base_len (base a) == US.v n /\ offset a == 0 }) emp (fun a -> pts_to (| a, Ghost.hide (US.v n) |) P.full_perm (Seq.create (US.v n) x)) /// Allocating a new array of size n, where each cell is initialized /// with value x let is_full_array (#elt: Type) (a: array elt) : Tot prop = length a == base_len (base (ptr_of a)) inline_for_extraction [@@noextract_to "krml"] let malloc (#elt: Type) (x: elt) (n: US.t) : ST (array elt) emp (fun a -> pts_to a P.full_perm (Seq.create (US.v n) x)) (True) (fun a -> length a == US.v n /\ is_full_array a ) = let p = malloc_ptr x n in let a : array elt = (| p, Ghost.hide (US.v n) |) in rewrite (pts_to _ _ _) (pts_to a _ _); return a /// Freeing a full array. Same here, we expose a ptr version for extraction purposes only [@@ noextract_to "krml"; // primitive warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] val free_ptr (#elt: Type) (#s: Ghost.erased (Seq.seq elt)) (a: ptr elt { offset a == 0 }) : STT unit (pts_to (| a, Ghost.hide #nat (base_len (base a)) |) P.full_perm s) (fun _ -> emp) inline_for_extraction [@@ noextract_to "krml"; warn_on_use "Steel.HigherArray.free is currently unsound in the presence of zero-size subarrays, have you collected them all?"] let free (#elt: Type) (a: array elt) : ST unit (exists_ (pts_to a P.full_perm)) (fun _ -> emp) ( is_full_array a ) (fun _ -> True) = let (| p, v |) = a in let _ : squash (offset p == 0) = () in let s = elim_exists () in rewrite (pts_to _ _ _) (pts_to (| p, Ghost.hide (base_len (base p)) |) full_perm s); free_ptr p /// Sharing and gathering permissions on an array. Those only /// manipulate permissions, so they are nothing more than stateful /// lemmas. val share (#opened: _) (#elt: Type) (#x: Seq.seq elt) (a: array elt) (p p1 p2: P.perm) : STGhost unit opened (pts_to a p x) (fun _ -> pts_to a p1 x `star` pts_to a p2 x) (p == p1 `P.sum_perm` p2) (fun _ -> True) val gather (#opened: _) (#elt: Type) (a: array elt) (#x1: Seq.seq elt) (p1: P.perm) (#x2: Seq.seq elt) (p2: P.perm) : STGhost unit opened (pts_to a p1 x1 `star` pts_to a p2 x2) (fun _ -> pts_to a (p1 `P.sum_perm` p2) x1) (True) (fun _ -> x1 == x2) /// Reading the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val index_ptr (#t: Type) (#p: P.perm) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to (| a, len |) p s) (fun _ -> pts_to (| a, len |) p s) (US.v i < Ghost.reveal len \/ US.v i < Seq.length s) (fun res -> Seq.length s == Ghost.reveal len /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) inline_for_extraction [@@noextract_to "krml"] // primitive let index (#t: Type) (#p: P.perm) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t) : ST t (pts_to a p s) (fun _ -> pts_to a p s) (US.v i < length a \/ US.v i < Seq.length s) (fun res -> Seq.length s == length a /\ US.v i < Seq.length s /\ res == Seq.index s (US.v i)) = rewrite (pts_to _ _ _) (pts_to (| (ptr_of a), (dsnd a) |) p s); let res = index_ptr (ptr_of a) i in rewrite (pts_to _ _ _) (pts_to a p s); return res /// Writing the value v at the i-th element of an array a. /// TODO: we should also provide an atomic version for small types. [@@noextract_to "krml"] // primitive val upd_ptr (#t: Type) (a: ptr t) (#len: Ghost.erased nat { offset a + len <= base_len (base a) }) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to (| a, len |) P.full_perm s) (fun res -> pts_to (| a, len |) P.full_perm (Seq.upd s (US.v i) v)) inline_for_extraction [@@noextract_to "krml"] let upd (#t: Type) (a: array t) (#s: Ghost.erased (Seq.seq t)) (i: US.t { US.v i < Seq.length s }) (v: t) : STT unit (pts_to a P.full_perm s) (fun res -> pts_to a P.full_perm (Seq.upd s (US.v i) v)) = rewrite (pts_to _ _ _) (pts_to (| ptr_of a, (dsnd a) |) _ s); upd_ptr (ptr_of a) i v; rewrite (pts_to _ _ _) (pts_to _ _ _) /// An array a1 is adjacent to an array a2 if and only if they have /// the same base array and the end of a1 coincides with the beginning /// of a2 let adjacent (#elt: Type) (a1 a2: array elt) : Tot prop = base (ptr_of a1) == base (ptr_of a2) /\ offset (ptr_of a1) + (length a1) == offset (ptr_of a2) /// If two arrays are adjacent, then we can compute their merge, with /// their combined lengths. By virtue of the length being ghost, /// Karamel will extract it as "let y = a1" inline_for_extraction [@@noextract_to "krml"] let merge (#elt: Type) (a1: array elt) (a2: Ghost.erased (array elt)) : Pure (array elt) (requires (adjacent a1 a2)) (ensures (fun y -> length y == length a1 + length a2)) = (| ptr_of a1, Ghost.hide (length a1 + length a2) |) /// Adjacency and merging are associative. let merge_assoc (#elt: Type) (a1 a2 a3: array elt) : Lemma (requires ( (adjacent a1 a2 /\ adjacent a2 a3) \/ (adjacent a1 a2 /\ adjacent (merge a1 a2) a3) \/ (adjacent a2 a3 /\ adjacent a1 (merge a2 a3)) )) (ensures ( adjacent (merge a1 a2) a3 /\ adjacent a1 (merge a2 a3) /\ merge (merge a1 a2) a3 == merge a1 (merge a2 a3) )) = () /// A shortcut to combine adjacency and merging let merge_into (#elt: Type) (a1 a2 a: array elt) : Tot prop = adjacent a1 a2 /\ merge a1 a2 == a /// Spatial merging of two arrays, expressed in terms of `merge`. val ghost_join (#opened: _) (#elt: Type) (#x1 #x2: Seq.seq elt) (#p: P.perm) (a1 a2: array elt) (h: squash (adjacent a1 a2)) : STGhostT unit opened (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to (merge a1 a2) p (x1 `Seq.append` x2)) /// Spatial merging, combining the use of `merge` and the call to the /// stateful lemma. Since the only operations are calls to stateful /// lemmas and pure computations, the overall computation is atomic /// and unobservable, so can be used anywhere in atomic contexts. By /// virtue of the length being ghost, Karamel will extract this to /// "let res = a1" inline_for_extraction // this will extract to "let res = a1" [@@noextract_to "krml"] let join (#opened: _) (#elt: Type) (#x1 #x2: Ghost.erased (Seq.seq elt)) (#p: P.perm) (a1: array elt) (a2: Ghost.erased (array elt)) : STAtomicBase (array elt) false opened Unobservable (pts_to a1 p x1 `star` pts_to a2 p x2) (fun res -> pts_to res p (x1 `Seq.append` x2)) (adjacent a1 a2) (fun res -> merge_into a1 a2 res) = let _ : squash (adjacent a1 a2) = () in ghost_join a1 a2 (); let res = merge a1 a2 in rewrite (pts_to (merge a1 (Ghost.hide (Ghost.reveal a2))) p (x1 `Seq.append` x2)) (pts_to res p (x1 `Seq.append` x2)); return res /// Computing the left-hand-side part of splitting an array a at /// offset i. By virtue of the length being ghost, Karamel will /// extract this to "let y = a" inline_for_extraction // this will extract to "let y = a" [@@noextract_to "krml"] let split_l (#elt: Type) (a: array elt) (i: Ghost.erased US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> True)) = (| ptr_of a, Ghost.hide (US.v i) |) /// C pointer arithmetic to compute (p+off), shifting a pointer p by /// offset off. TODO: replace this with a Ghost definition and a /// STAtomicBase Unobservable operation with the corresponding /// permission. [@@noextract_to "krml"] // primitive val ptr_shift (#elt: Type) (p: ptr elt) (off: US.t) : Pure (ptr elt) (requires (offset p + US.v off <= base_len (base p))) (ensures (fun p' -> base p' == base p /\ offset p' == offset p + US.v off )) let ptr_shift_zero (#elt: Type) (p: ptr elt) : Lemma (ptr_shift p 0sz == p) = ptr_base_offset_inj (ptr_shift p 0sz) p /// Computing the right-hand-side part of splitting an array a at /// offset i. inline_for_extraction
{ "checked_file": "/", "dependencies": [ "Steel.ST.Util.fsti.checked", "Steel.FractionalPermission.fst.checked", "prims.fst.checked", "FStar.SizeT.fsti.checked", "FStar.Seq.fst.checked", "FStar.PtrdiffT.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Int.fsti.checked", "FStar.Ghost.fsti.checked" ], "interface_file": false, "source_file": "Steel.ST.HigherArray.fsti" }
[ { "abbrev": false, "full_module": "Steel.ST.Util", "short_module": null }, { "abbrev": true, "full_module": "FStar.PtrdiffT", "short_module": "UP" }, { "abbrev": true, "full_module": "FStar.SizeT", "short_module": "US" }, { "abbrev": true, "full_module": "Steel.FractionalPermission", "short_module": "P" }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "Steel.ST", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
a: Steel.ST.HigherArray.array elt -> i: FStar.SizeT.t -> Prims.Pure (Steel.ST.HigherArray.array elt)
Prims.Pure
[]
[]
[ "Steel.ST.HigherArray.array", "FStar.SizeT.t", "Prims.Mkdtuple2", "Steel.ST.HigherArray.ptr", "FStar.Ghost.erased", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Steel.ST.HigherArray.offset", "FStar.Ghost.reveal", "Steel.ST.HigherArray.base_len", "Steel.ST.HigherArray.base", "Steel.ST.HigherArray.ptr_shift", "Steel.ST.HigherArray.ptr_of", "FStar.Ghost.hide", "Prims.op_Subtraction", "Steel.ST.HigherArray.length", "FStar.SizeT.v", "Steel.ST.HigherArray.merge_into", "Steel.ST.HigherArray.split_l" ]
[]
false
false
false
false
false
let split_r (#elt: Type) (a: array elt) (i: US.t) : Pure (array elt) (requires (US.v i <= length a)) (ensures (fun y -> merge_into (split_l a i) y a)) =
(| ptr_shift (ptr_of a) i, Ghost.hide (length a - US.v i) |)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fsub
val va_lemma_Fsub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fsub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a - b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
val va_lemma_Fsub : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fsub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a - b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))
let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2545, "start_col": 0, "start_line": 2509 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (()))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Prims.op_Subtraction", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fsub" ]
[]
false
false
false
false
false
let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let a0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3:Vale.Def.Types_s.nat64 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let a:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b:Prims.nat = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fmul1_stdcall
val va_wpProof_Fmul1_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fmul1_stdcall win dst_b inA_b inB_in va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fmul1_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fmul1_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fmul1_stdcall win dst_b inA_b inB_in va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fmul1_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fmul1_stdcall win dst_b inA_b inB_in va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1_stdcall (va_code_Fmul1_stdcall win) va_s0 win dst_b inA_b inB_in in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 3020, "start_col": 0, "start_line": 3002 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Fmul1_stdcall #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1_stdcall win = (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1_stdcall win = (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ())))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fmul1 ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1233 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1234 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1235 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1240 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1241 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1242 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1243 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1246 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fmul1 dst_b inA_b inB_in) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1248 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1250 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1253 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1254 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1255 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1_stdcall va_b0 va_s0 win dst_b inA_b inB_in = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1_stdcall va_mods win dst_b inA_b inB_in in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1166 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1195 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1196 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1197 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1198 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1200 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1201 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1202 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1203 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1205 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1208 column 47 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a inB_in `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1214 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1216 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1217 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1218 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1219 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1220 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1221 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1222 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1223 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1224 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1225 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1226 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1227 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1228 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1230 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_in: Vale.X64.Memory.nat64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_stackTaint", "Vale.X64.Decls.va_update_stack", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fmul1_stdcall", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1_stdcall" ]
[]
false
false
false
false
false
let va_wpProof_Fmul1_stdcall win dst_b inA_b inB_in va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fmul1_stdcall (va_code_Fmul1_stdcall win) va_s0 win dst_b inA_b inB_in in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0) )))))))))))))) )))))))); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_from_mont
val bn_from_mont: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
val bn_from_mont: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> lbignum t nLen
let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 140, "start_col": 0, "start_line": 137 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> Hacl.Spec.Bignum.Definitions.lbignum t nLen
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Lib.Sequence.lseq", "Prims.l_and", "Prims.eq2", "Lib.Sequence.sub", "Prims.l_Forall", "Prims.nat", "Prims.l_or", "Prims.op_LessThan", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.Sequence.index", "Lib.Sequence.update_sub", "FStar.Seq.Base.seq", "FStar.Seq.Base.create", "Lib.IntTypes.mk_int", "Lib.IntTypes.SEC", "Prims.l_imp", "Lib.Sequence.create", "Lib.IntTypes.uint" ]
[]
false
false
false
false
false
let bn_from_mont #t #nLen n mu aM =
let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_wpProof_Fsub_stdcall
val va_wpProof_Fsub_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fsub_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
val va_wpProof_Fsub_stdcall : win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fsub_stdcall win) ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g))))
let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 22, "end_line": 2729, "start_col": 0, "start_line": 2711 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> va_s0: Vale.X64.Decls.va_state -> va_k: (_: Vale.X64.Decls.va_state -> _: Prims.unit -> Type0) -> Prims.Ghost ((Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel) * Prims.unit)
Prims.Ghost
[]
[]
[ "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.Decls.va_state", "Prims.unit", "Vale.X64.Decls.va_fuel", "FStar.Pervasives.Native.Mktuple3", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "Prims._assert", "Vale.X64.Decls.va_state_eq", "Vale.X64.Decls.va_update_stackTaint", "Vale.X64.Decls.va_update_stack", "Vale.X64.Decls.va_update_mem_layout", "Vale.X64.Decls.va_update_mem_heaplet", "Vale.X64.Decls.va_update_flags", "Vale.X64.Decls.va_update_reg64", "Vale.X64.Decls.va_update_ok", "Vale.X64.Decls.va_update_mem", "Vale.X64.Decls.va_lemma_upd_update", "FStar.Pervasives.Native.tuple3", "FStar.Pervasives.Native.tuple2", "Vale.X64.State.vale_state", "Vale.Curve25519.X64.FastHybrid.va_lemma_Fsub_stdcall", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub_stdcall" ]
[]
false
false
false
false
false
let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k =
let va_sM, va_f0 = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0) )))))))))))))) )))))))); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem ]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fsub_stdcall
val va_lemma_Fsub_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fsub_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inB_in inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a - b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
val va_lemma_Fsub_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fsub_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ dst_b == inA_b) /\ (Vale.X64.Decls.buffers_disjoint dst_b inB_b \/ dst_b == inB_b) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inB_in inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == (a - b) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2707, "start_col": 0, "start_line": 2624 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (()))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 60, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_b: Vale.X64.Memory.buffer64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fsub_stdcall", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Prims.op_Subtraction", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.l_imp", "Vale.Def.Types_s.nat64", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fsub_stdcall" ]
[]
false
false
false
false
false
let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b =
let va_mods:va_mods_t = [ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let inB_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))) ))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.size32_bounded_bv
val size32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: size32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (size32 (serialize_bounded_bv min max hs))
val size32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: size32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (size32 (serialize_bounded_bv min max hs))
let size32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: size32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (size32 (serialize_bounded_bv min max hs)) = size32_dtuple2 hs32 (fun (x: bounded_int32 min max) -> size32_weaken (parse_bounded_bv_payload_kind min max) (size32_bv (U32.v x)))
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 115, "end_line": 146, "start_col": 0, "start_line": 136 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul () let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) () let serialize32_bv (n: nat { n / 8 < 4294967295 }) : Tot (serializer32 (serialize_bv n)) = if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ (serialize32_extra_bv8 n `serialize32_nondep_then` serialize32_byte_bv (n / 8)) (synth_bv_recip n) (fun x -> synth_bv_recip n x) () let size32_bv (n: nat { n / 8 < 4294967295 }) : Tot (size32 (serialize_bv n)) = size32_constant _ (if n % 8 = 0 then U32.uint_to_t (n / 8) else U32.uint_to_t (1 + n / 8)) () let parse32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp)) = parse32_dtuple2 hp32 (fun (x: bounded_int32 min max) -> parse32_weaken (parse_bounded_bv_payload_kind min max) (parse32_bv (U32.v x))) #push-options "--z3rlimit 16" let serialize32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: serializer32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (serializer32 (serialize_bounded_bv min max hs)) = serialize32_dtuple2 hs32 (fun (x: bounded_int32 min max) -> serialize32_weaken (parse_bounded_bv_payload_kind min max) (serialize32_bv (U32.v x)))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 16, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
min: Prims.nat -> max: Prims.nat{min <= max} -> hs32: LowParse.SLow.Base.size32 hs { Mkparser_kind'?.parser_kind_subkind hk == FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\ LowParse.SLow.Combinators.serialize32_kind_precond hk (LowParse.Spec.BitVector.parse_bounded_bv_payload_kind min max) } -> LowParse.SLow.Base.size32 (LowParse.Spec.BitVector.serialize_bounded_bv min max hs)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "LowParse.Spec.Base.parser_kind", "LowParse.Spec.Base.parser", "LowParse.Spec.BoundedInt.bounded_int32", "LowParse.Spec.Base.serializer", "LowParse.SLow.Base.size32", "Prims.l_and", "Prims.eq2", "FStar.Pervasives.Native.option", "LowParse.Spec.Base.parser_subkind", "LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind", "FStar.Pervasives.Native.Some", "LowParse.Spec.Base.ParserStrong", "LowParse.SLow.Combinators.serialize32_kind_precond", "LowParse.Spec.BitVector.parse_bounded_bv_payload_kind", "LowParse.SLow.Combinators.size32_dtuple2", "FStar.BitVector.bv_t", "FStar.UInt32.v", "LowParse.Spec.Base.weaken", "LowParse.Spec.BitVector.parse_bv_kind", "LowParse.Spec.BitVector.parse_bv", "LowParse.Spec.Combinators.serialize_weaken", "LowParse.Spec.BitVector.serialize_bv", "LowParse.SLow.Combinators.size32_weaken", "LowParse.SLow.BitVector.size32_bv", "LowParse.Spec.BitVector.parse_bounded_bv_kind", "LowParse.Spec.BitVector.bounded_bv_t", "LowParse.Spec.BitVector.parse_bounded_bv", "LowParse.Spec.BitVector.serialize_bounded_bv" ]
[]
false
false
false
false
false
let size32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: size32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (size32 (serialize_bounded_bv min max hs)) =
size32_dtuple2 hs32 (fun (x: bounded_int32 min max) -> size32_weaken (parse_bounded_bv_payload_kind min max) (size32_bv (U32.v x)))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_one_lemma
val bn_mont_one_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n) (ensures (let oneM = bn_v (bn_mont_one n mu r2) in oneM == M.mont_one (bits t) nLen (bn_v n) (v mu) /\ oneM < bn_v n))
val bn_mont_one_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n) (ensures (let oneM = bn_v (bn_mont_one n mu r2) in oneM == M.mont_one (bits t) nLen (bn_v n) (v mu) /\ oneM < bn_v n))
let bn_mont_one_lemma #t #nLen n mu r2 = bn_from_mont_lemma #t #nLen n mu r2
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 37, "end_line": 453, "start_col": 0, "start_line": 452 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2) let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM) let bn_to_mont_lemma #t #nLen n mu r2 a = let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in // c = a * r2 BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in // aM = c % n bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c)) let bn_from_mont_lemma #t #nLen n mu aM = let r = pow2 (bits t * nLen) in let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_eval_update_sub nLen aM (nLen + nLen); assert (bn_v tmp == bn_v aM); bn_eval_bound aM nLen; assert (bn_v tmp < r); let a = bn_mont_reduction n mu tmp in bn_mont_reduction_lemma n mu tmp; assert (bn_v a == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v tmp)) let bn_mont_mul_lemma #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); Math.Lemmas.lemma_mult_lt_sqr (bn_v aM) (bn_v bM) (bn_v n); assert (bn_v c < bn_v n * bn_v n); bn_eval_bound n nLen; bn_mont_reduction_lemma n mu c let bn_mont_sqr_lemma #t #nLen n mu aM = bn_mont_mul_lemma #t #nLen n mu aM aM
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> r2: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu /\ Hacl.Spec.Bignum.Definitions.bn_v r2 == Prims.pow2 ((2 * Lib.IntTypes.bits t) * nLen) % Hacl.Spec.Bignum.Definitions.bn_v n) (ensures (let oneM = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_mont_one n mu r2) in oneM == Hacl.Spec.Montgomery.Lemmas.mont_one (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) /\ oneM < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_from_mont_lemma", "Prims.unit" ]
[]
true
false
true
false
false
let bn_mont_one_lemma #t #nLen n mu r2 =
bn_from_mont_lemma #t #nLen n mu r2
false
Hacl.Spec.Curve25519.Field64.fst
Hacl.Spec.Curve25519.Field64.carry_pass_store
val carry_pass_store: f:CC.felem -> CC.felem
val carry_pass_store: f:CC.felem -> CC.felem
let carry_pass_store f = let top_bit = f.[3] >>. 63ul in let f3' = f.[3] &. u64 0x7fffffffffffffff in let r0 = f.[3] <- f3' in let (c, r1) = CC.add1 r0 (u64 19 *! top_bit) in r1
{ "file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 4, "end_line": 28, "start_col": 0, "start_line": 23 }
module Hacl.Spec.Curve25519.Field64 open FStar.Mul open Lib.Sequence open Lib.IntTypes open Spec.Curve25519 open Hacl.Spec.Curve25519.Field64.Definition module Lemmas = Hacl.Spec.Curve25519.Field64.Lemmas module CC = Hacl.Spec.Curve25519.Field64.Core module SD = Hacl.Spec.Bignum.Definitions module SB = Hacl.Spec.Bignum module SL = Hacl.Spec.Bignum.Lib #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Curve25519.Field64.Lemmas.fst.checked", "Hacl.Spec.Curve25519.Field64.Definition.fst.checked", "Hacl.Spec.Curve25519.Field64.Core.fst.checked", "Hacl.Spec.Bignum.Lib.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.Curve25519.Field64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Lib", "short_module": "SL" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "SB" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": "SD" }, { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.Field64.Core", "short_module": "CC" }, { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.Field64.Lemmas", "short_module": "Lemmas" }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519.Field64.Definition", "short_module": null }, { "abbrev": false, "full_module": "Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Spec.Curve25519.Field64.Core.felem -> Hacl.Spec.Curve25519.Field64.Core.felem
Prims.Tot
[ "total" ]
[]
[ "Hacl.Spec.Curve25519.Field64.Core.felem", "Lib.IntTypes.uint64", "FStar.Pervasives.Native.tuple2", "Lib.IntTypes.int_t", "Lib.IntTypes.U64", "Lib.IntTypes.SEC", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Curve25519.Field64.Core.add1", "Lib.IntTypes.op_Star_Bang", "Lib.IntTypes.u64", "Lib.Sequence.lseq", "Hacl.Spec.Bignum.Definitions.limb", "Prims.l_and", "Prims.eq2", "FStar.Seq.Base.seq", "Lib.Sequence.to_seq", "FStar.Seq.Base.upd", "Lib.Sequence.index", "Prims.l_Forall", "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Subtraction", "Prims.pow2", "Prims.l_imp", "Prims.op_LessThan", "Prims.op_disEquality", "Prims.l_or", "FStar.Seq.Base.index", "Lib.Sequence.op_String_Assignment", "Lib.IntTypes.op_Amp_Dot", "Lib.Sequence.op_String_Access", "Lib.IntTypes.op_Greater_Greater_Dot", "FStar.UInt32.__uint_to_t" ]
[]
false
false
false
true
false
let carry_pass_store f =
let top_bit = f.[ 3 ] >>. 63ul in let f3' = f.[ 3 ] &. u64 0x7fffffffffffffff in let r0 = f.[ 3 ] <- f3' in let c, r1 = CC.add1 r0 (u64 19 *! top_bit) in r1
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_sqr_lemma
val bn_mont_sqr_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v aM < bn_v n) (ensures (let res = bn_v (bn_mont_sqr n mu aM) in res == M.mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v aM) /\ res < bn_v n))
val bn_mont_sqr_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v aM < bn_v n) (ensures (let res = bn_v (bn_mont_sqr n mu aM) in res == M.mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v aM) /\ res < bn_v n))
let bn_mont_sqr_lemma #t #nLen n mu aM = bn_mont_mul_lemma #t #nLen n mu aM aM
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 39, "end_line": 449, "start_col": 0, "start_line": 448 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2) let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM) let bn_to_mont_lemma #t #nLen n mu r2 a = let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in // c = a * r2 BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in // aM = c % n bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c)) let bn_from_mont_lemma #t #nLen n mu aM = let r = pow2 (bits t * nLen) in let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_eval_update_sub nLen aM (nLen + nLen); assert (bn_v tmp == bn_v aM); bn_eval_bound aM nLen; assert (bn_v tmp < r); let a = bn_mont_reduction n mu tmp in bn_mont_reduction_lemma n mu tmp; assert (bn_v a == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v tmp)) let bn_mont_mul_lemma #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); Math.Lemmas.lemma_mult_lt_sqr (bn_v aM) (bn_v bM) (bn_v n); assert (bn_v c < bn_v n * bn_v n); bn_eval_bound n nLen; bn_mont_reduction_lemma n mu c
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu /\ Hacl.Spec.Bignum.Definitions.bn_v aM < Hacl.Spec.Bignum.Definitions.bn_v n) (ensures (let res = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_mont_sqr n mu aM) in res == Hacl.Spec.Montgomery.Lemmas.mont_mul (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v aM) (Hacl.Spec.Bignum.Definitions.bn_v aM) /\ res < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_mul_lemma", "Prims.unit" ]
[]
true
false
true
false
false
let bn_mont_sqr_lemma #t #nLen n mu aM =
bn_mont_mul_lemma #t #nLen n mu aM aM
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_to_mont_lemma
val bn_to_mont_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> a:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n) (ensures (let aM = bn_v (bn_to_mont n mu r2 a) in aM == M.to_mont (bits t) nLen (bn_v n) (v mu) (bn_v a) /\ aM < bn_v n))
val bn_to_mont_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> r2:lbignum t nLen -> a:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v r2 == pow2 (2 * bits t * nLen) % bn_v n) (ensures (let aM = bn_v (bn_to_mont n mu r2 a) in aM == M.to_mont (bits t) nLen (bn_v n) (v mu) (bn_v a) /\ aM < bn_v n))
let bn_to_mont_lemma #t #nLen n mu r2 a = let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in // c = a * r2 BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in // aM = c % n bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c))
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 77, "end_line": 421, "start_col": 0, "start_line": 411 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2) let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> r2: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> a: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu /\ Hacl.Spec.Bignum.Definitions.bn_v r2 == Prims.pow2 ((2 * Lib.IntTypes.bits t) * nLen) % Hacl.Spec.Bignum.Definitions.bn_v n) (ensures (let aM = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_to_mont n mu r2 a) in aM == Hacl.Spec.Montgomery.Lemmas.to_mont (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v a) /\ aM < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Prims._assert", "Prims.eq2", "Prims.nat", "Hacl.Spec.Bignum.Definitions.bn_v", "Hacl.Spec.Montgomery.Lemmas.mont_reduction", "Lib.IntTypes.bits", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Prims.unit", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_lemma", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Prims.op_LessThan", "FStar.Mul.op_Star", "Hacl.Spec.Montgomery.Lemmas.mult_lt_lemma", "Hacl.Spec.Bignum.Definitions.bn_eval_bound", "Hacl.Spec.Bignum.bn_mul_lemma", "Hacl.Spec.Bignum.bn_mul", "Prims.pos", "Prims.pow2" ]
[]
true
false
true
false
false
let bn_to_mont_lemma #t #nLen n mu r2 a =
let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_lemma
val bn_mont_reduction_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (requires bn_mont_pre n mu /\ bn_v c < bn_v n * pow2 (bits t * nLen)) (ensures (let res = bn_v (bn_mont_reduction n mu c) in res == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c) /\ res < bn_v n))
val bn_mont_reduction_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (requires bn_mont_pre n mu /\ bn_v c < bn_v n * pow2 (bits t * nLen)) (ensures (let res = bn_v (bn_mont_reduction n mu c) in res == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c) /\ res < bn_v n))
let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM)
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 28, "end_line": 408, "start_col": 0, "start_line": 376 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> c: Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen) -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu /\ Hacl.Spec.Bignum.Definitions.bn_v c < Hacl.Spec.Bignum.Definitions.bn_v n * Prims.pow2 (Lib.IntTypes.bits t * nLen)) (ensures (let res = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_mont_reduction n mu c) in res == Hacl.Spec.Montgomery.Lemmas.mont_reduction (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v c) /\ res < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Base.carry", "Prims.int", "Prims._assert", "Prims.eq2", "Prims.nat", "Hacl.Spec.Bignum.Definitions.bn_v", "Prims.unit", "Prims.op_LessThan", "FStar.Math.Lemmas.small_mod", "Prims.bool", "Prims.op_Modulus", "FStar.Math.Lemmas.lemma_mod_sub", "Hacl.Spec.Montgomery.Lemmas.mont_reduction_loop_div_r", "Lib.IntTypes.bits", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "FStar.Mul.op_Star", "Hacl.Spec.Montgomery.Lemmas.mont_reduction_lemma", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Montgomery.Lemmas.eea_pow2_odd", "Hacl.Spec.Montgomery.Lemmas.mont_reduction", "Hacl.Spec.Bignum.bn_reduce_once_lemma", "Hacl.Spec.Bignum.bn_reduce_once", "Hacl.Spec.Montgomery.Lemmas.lemma_fits_c_lt_rn", "Prims.op_Division", "Prims.op_Subtraction", "Hacl.Spec.Montgomery.Lemmas.mont_reduction_loop_div_r_fits_lemma", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r_lemma", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_loop_div_r", "Prims.pos", "Prims.pow2" ]
[]
false
false
true
false
false
let bn_mont_reduction_lemma #t #nLen n mu res0 =
let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in if resM1 < bn_v n then (Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM)) else (Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM)); assert (bn_v res2 == resM)
false
Vale.Curve25519.X64.FastHybrid.fst
Vale.Curve25519.X64.FastHybrid.va_lemma_Fmul1_stdcall
val va_lemma_Fmul1_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fmul1_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB_in < 131072))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == va_mul_nat a inB_in `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
val va_lemma_Fmul1_stdcall : va_b0:va_code -> va_s0:va_state -> win:bool -> dst_b:buffer64 -> inA_b:buffer64 -> inB_in:nat64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fmul1_stdcall win) va_s0 /\ va_get_ok va_s0 /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in va_get_reg64 rRsp va_s0 == Vale.X64.Stack_i.init_rsp (va_get_stack va_s0) /\ Vale.X64.Memory.is_initial_heap (va_get_mem_layout va_s0) (va_get_mem va_s0) /\ (adx_enabled /\ bmi2_enabled) /\ (Vale.X64.Decls.buffers_disjoint dst_b inA_b \/ inA_b == dst_b) /\ inB_in = (if win then va_get_reg64 rR8 va_s0 else va_get_reg64 rRdx va_s0) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem va_s0) dst_in dst_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem va_s0) inA_in inA_b 4 (va_get_mem_layout va_s0) Secret /\ inB_in < 131072))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRcx va_s0 else va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = (if win then va_get_reg64 rRdx va_s0 else va_get_reg64 rRsi va_s0) in let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in d `op_Modulus` prime == va_mul_nat a inB_in `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM) /\ (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))))
let va_lemma_Fmul1_stdcall va_b0 va_s0 win dst_b inA_b inB_in = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1_stdcall va_mods win dst_b inA_b inB_in in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1166 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1195 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1196 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1197 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1198 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1200 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1201 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1202 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1203 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1205 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1208 column 47 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a inB_in `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1214 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1216 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1217 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1218 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1219 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1220 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1221 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1222 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1223 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1224 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1225 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1226 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1227 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1228 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1230 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM)
{ "file_name": "obj/Vale.Curve25519.X64.FastHybrid.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 16, "end_line": 2998, "start_col": 0, "start_line": 2926 }
module Vale.Curve25519.X64.FastHybrid open Vale.Def.Types_s open Vale.Arch.Types open Vale.X64.Machine_s open Vale.X64.Memory open Vale.X64.State open Vale.X64.Decls open Vale.X64.InsBasic open Vale.X64.InsMem open Vale.X64.InsStack open Vale.X64.QuickCode open Vale.X64.QuickCodes open FStar.Tactics open Vale.Curve25519.Fast_defs open Vale.Curve25519.Fast_lemmas_external open Vale.Curve25519.FastHybrid_helpers open Vale.Curve25519.FastUtil_helpers open Vale.X64.CPU_Features_s #reset-options "--z3rlimit 60" //-- Fast_mul1 #push-options "--z3rlimit 600" val va_code_Fast_mul1 : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1 offset = (va_Block (va_CCons (va_code_Comment "Compute the raw multiplication of f1*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[0]*f2" ) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Space 2) (va_CCons (va_code_Comment "f1[1]*f2" ) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[2]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_NoNewline ()) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_CCons (va_code_Comment "f1[3]*f2" ) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))))) val va_codegen_success_Fast_mul1 : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1 offset = (va_pbool_and (va_codegen_success_Comment "Compute the raw multiplication of f1*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[0]*f2" ) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Space 2) (va_pbool_and (va_codegen_success_Comment "f1[1]*f2" ) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[2]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_NoNewline ()) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (va_pbool_and (va_codegen_success_Comment "f1[3]*f2" ) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1 (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 98 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw multiplication of f1*f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 99 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 101 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) inA_b (0 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 102 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRcx) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg61:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg60:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg59:Vale.Def.Types_s.nat64) = va_get_reg64 rRcx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 102 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg59 va_arg60 va_arg61 a0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 144 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 102 column 156 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[0]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 103 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) inA_b (1 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 104 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg58:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg57:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg56:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 104 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg56 va_arg57 va_arg58 a1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 145 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Space 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 104 column 157 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[1]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 105 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 106 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 107 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) inA_b (2 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 108 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg55:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg54:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg53:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 108 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg53 va_arg54 va_arg55 a2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 108 column 147 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[2]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 109 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 110 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_NoNewline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) inA_b (3 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 111 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + 8 `op_Multiply` offset) Secret)) (fun (va_s:va_state) _ -> let (va_arg52:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 111 column 122 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg50 va_arg51 va_arg52 a3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 111 column 149 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "f1[3]*f2" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 112 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 113 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 116 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg49:prop) = va_mul_nat a (va_get_reg64 rRdx va_s) == 0 + Vale.Curve25519.Fast_defs.pow2_four (va_mul_nat (va_get_reg64 rRdx va_s) a0) (va_mul_nat (va_get_reg64 rRdx va_s) a1) (va_mul_nat (va_get_reg64 rRdx va_s) a2) (va_mul_nat (va_get_reg64 rRdx va_s) a3) in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 117 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg49 int_canon) (va_QEmpty (())))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1 : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1 offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1 va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1 va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1 offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 54 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 92 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 93 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a (va_get_reg64 rRdx va_s0)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 95 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_sM < pow2_64 - 1) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 96 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1 (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 4) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a (va_get_reg64 rRdx va_s0) /\ va_get_reg64 rRax va_sM < pow2_64 - 1 /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1 : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1 offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1 offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1 (va_code_Fast_mul1 offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1 (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1 offset)) = (va_QProc (va_code_Fast_mul1 offset) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_mul1 offset inA_b) (va_wpProof_Fast_mul1 offset inA_b)) #pop-options //-- //-- Fast_add_after_mul1_regs #push-options "--z3rlimit 600" val va_code_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add_after_mul1_regs () = (va_Block (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))))))))) val va_codegen_success_Fast_add_after_mul1_regs : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add_after_mul1_regs () = (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add_after_mul1_regs (va_mods:va_mods_t) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (va_get_reg64 rRax va_s) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 228 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 230 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRcx) (va_op_reg_opr64_reg64 rRsi) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 231 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 232 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRcx) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 234 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRdx) (va_op_reg_opr64_reg64 rRsi) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 235 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 237 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rRbx) (va_op_reg_opr64_reg64 rRsi) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 240 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR13) (va_op_reg_opr64_reg64 rRsi) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 241 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 243 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))))))) val va_lemma_Fast_add_after_mul1_regs : va_b0:va_code -> va_s0:va_state -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add_after_mul1_regs ()) va_s0 /\ va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_add_after_mul1_regs va_b0 va_s0 inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Fast_add_after_mul1_regs va_mods inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add_after_mul1_regs ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 185 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 225 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 226 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add_after_mul1_regs (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret /\ va_get_reg64 rRax va_s0 < pow2_64 - 1) /\ (forall (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_rcx:nat64) (va_x_rdx:nat64) (va_x_rbx:nat64) (va_x_r13:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax va_s0))))))))) in va_get_ok va_sM /\ (let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) (va_get_reg64 rRax va_s0) in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == a + b) ==> va_k va_sM (()))) val va_wpProof_Fast_add_after_mul1_regs : inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add_after_mul1_regs inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add_after_mul1_regs inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add_after_mul1_regs (va_code_Fast_add_after_mul1_regs ()) va_s0 inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add_after_mul1_regs (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add_after_mul1_regs ())) = (va_QProc (va_code_Fast_add_after_mul1_regs ()) ([va_Mod_flags; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax]) (va_wp_Fast_add_after_mul1_regs inB_b) (va_wpProof_Fast_add_after_mul1_regs inB_b)) #pop-options //-- //-- Fast_mul1_add #push-options "--z3rlimit 600" val va_code_Fast_mul1_add : offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_mul1_add offset = (va_Block (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CNil ())))))))))))))))))))))))) val va_codegen_success_Fast_mul1_add : offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_mul1_add offset = (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_ttrue ()))))))))))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_mul1_add (va_mods:va_mods_t) (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 296 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 298 column 30 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) inA_b (4 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 298 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (32 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg100:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg99:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg98:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 298 column 121 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg98 va_arg99 va_arg100 a4) (let (ba4_hi:nat64) = va_get_reg64 rR13 va_s in let (ba4_lo:nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 302 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) inA_b (0 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 304 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (0 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 306 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) inA_b (5 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 306 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRbx) (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (40 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg97:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg96:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg95:Vale.Def.Types_s.nat64) = va_get_reg64 rRbx va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 306 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg95 va_arg96 va_arg97 a5) (let (ba5_hi:nat64) = va_get_reg64 rRbx va_s in let (ba5_lo:nat64) = va_get_reg64 rR9 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 309 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s1:nat64) = va_get_reg64 rR9 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) inA_b (1 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 312 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (8 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 314 column 28 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) inA_b (6 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 314 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rR13) (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (48 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg94:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg93:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg92:Vale.Def.Types_s.nat64) = va_get_reg64 rR13 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 314 column 119 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg92 va_arg93 va_arg94 a6) (let (ba6_hi:nat64) = va_get_reg64 rR13 va_s in let (ba6_lo:nat64) = va_get_reg64 rR10 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 317 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> let (s2:nat64) = va_get_reg64 rR10 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) inA_b (2 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 320 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (16 + offset `op_Multiply` 8) Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 322 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) inA_b (7 + offset) Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 322 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mulx64 (va_op_dst_opr64_reg64 rRax) (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (56 + offset `op_Multiply` 8) Secret)) (fun (va_s:va_state) _ -> let (va_arg91:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_s in let (va_arg90:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg89:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 322 column 120 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.Fast_lemmas_external.lemma_prod_bounds va_arg89 va_arg90 va_arg91 a7) (let (ba7_hi:nat64) = va_get_reg64 rRax va_s in let (ba7_lo:nat64) = va_get_reg64 rR11 va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 325 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rR13)) (fun (va_s:va_state) _ -> let (s3:nat64) = va_get_reg64 rR11 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) inA_b (3 + offset) Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 328 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) (24 + offset `op_Multiply` 8) Secret)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 330 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (s4:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 332 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adox64Wrap (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (fun (va_s:va_state) _ -> let (carry_bit:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 335 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (carry_bit == 0) (let (va_arg88:Vale.Def.Types_s.nat64) = s4 in let (va_arg87:Vale.Def.Types_s.nat64) = s3 in let (va_arg86:Vale.Def.Types_s.nat64) = s2 in let (va_arg85:Vale.Def.Types_s.nat64) = s1 in let (va_arg84:Vale.Def.Types_s.nat64) = ba7_lo in let (va_arg83:Vale.Def.Types_s.nat64) = ba7_hi in let (va_arg82:Vale.Def.Types_s.nat64) = ba6_lo in let (va_arg81:Vale.Def.Types_s.nat64) = ba6_hi in let (va_arg80:Vale.Def.Types_s.nat64) = ba5_lo in let (va_arg79:Vale.Def.Types_s.nat64) = ba5_hi in let (va_arg78:Vale.Def.Types_s.nat64) = ba4_lo in let (va_arg77:Vale.Def.Types_s.nat64) = ba4_hi in let (va_arg76:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 336 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fast_mul1 a' va_arg76 a4 a5 a6 a7 va_arg77 va_arg78 va_arg79 va_arg80 va_arg81 va_arg82 va_arg83 va_arg84 va_arg85 va_arg86 va_arg87 va_arg88) (let (d:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_five ba4_lo s1 s2 s3 s4 in let (va_arg75:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg74:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg73:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg72:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg71:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg70:Vale.Def.Types_s.nat64) = s4 in let (va_arg69:Vale.Def.Types_s.nat64) = s3 in let (va_arg68:Vale.Def.Types_s.nat64) = s2 in let (va_arg67:Vale.Def.Types_s.nat64) = s1 in let (va_arg66:Vale.Def.Types_s.nat64) = ba4_lo in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 340 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_addition a d a0 a1 a2 a3 va_arg66 va_arg67 va_arg68 va_arg69 va_arg70 va_arg71 va_arg72 va_arg73 va_arg74 va_arg75) (va_QEmpty (()))))))))))))))))))))))))))))))))) val va_lemma_Fast_mul1_add : va_b0:va_code -> va_s0:va_state -> offset:nat -> inA_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_mul1_add offset) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0)))))))))))) [@"opaque_to_smt"] let va_lemma_Fast_mul1_add va_b0 va_s0 offset inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok] in let va_qc = va_qcode_Fast_mul1_add va_mods offset inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_mul1_add offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 246 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 291 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 292 column 29 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 294 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRcx va_sM == 0)))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_mul1_add (offset:nat) (inA_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in adx_enabled /\ bmi2_enabled /\ (offset == 0 \/ offset == 8) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b (8 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_rcx:nat64) (va_x_rax:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_r13:nat64) (va_x_rbx:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rRbx va_x_rbx (va_upd_reg64 rR13 va_x_r13 (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRax va_x_rax (va_upd_reg64 rRcx va_x_rcx va_s0)))))))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (a':Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a4 a5 a6 a7 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (va_get_reg64 rRax va_sM) in d == va_mul_nat a' (va_get_reg64 rRdx va_s0) + a /\ va_get_reg64 rRcx va_sM == 0) ==> va_k va_sM (()))) val va_wpProof_Fast_mul1_add : offset:nat -> inA_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_mul1_add offset inA_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_mul1_add offset inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_mul1_add (va_code_Fast_mul1_add offset) va_s0 offset inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRax va_sM (va_update_reg64 rRcx va_sM (va_update_ok va_sM va_s0))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_mul1_add (offset:nat) (inA_b:buffer64) : (va_quickCode unit (va_code_Fast_mul1_add offset)) = (va_QProc (va_code_Fast_mul1_add offset) ([va_Mod_flags; va_Mod_reg64 rRbx; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRax; va_Mod_reg64 rRcx]) (va_wp_Fast_mul1_add offset inA_b) (va_wpProof_Fast_mul1_add offset inA_b)) #pop-options //-- //-- Store4 val va_code_Store4 : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Store4 () = (va_Block (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Store the result" ) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_CNil ())))))))) val va_codegen_success_Store4 : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Store4 () = (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Store the result" ) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Store4 (va_mods:va_mods_t) (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 367 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 368 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Store the result" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 369 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) 0 Secret dst_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 370 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) 8 Secret dst_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 371 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) 16 Secret dst_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 372 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) 24 Secret dst_b 3) (va_QEmpty (()))))))))) val va_lemma_Store4 : va_b0:va_code -> va_s0:va_state -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Store4 ()) va_s0 /\ va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret)) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Store4 va_b0 va_s0 dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Store4 va_mods dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Store4 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 347 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (label va_range1 "***** POSTCONDITION NOT MET AT line 359 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 360 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 361 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 362 column 45 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 364 column 50 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 365 column 69 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Store4 (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b 4 (va_get_mem_layout va_s0) Secret /\ (forall (va_x_mem:vale_heap) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_mem va_x_mem va_s0) in va_get_ok va_sM /\ (va_get_reg64 rR8 va_sM == Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR9 va_sM == Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR10 va_sM == Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem_heaplet 0 va_sM) /\ va_get_reg64 rR11 va_sM == Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.modifies_buffer dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b 4 (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Store4 : dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Store4 dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Store4 dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Store4 (va_code_Store4 ()) va_s0 dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Store4 (dst_b:buffer64) : (va_quickCode unit (va_code_Store4 ())) = (va_QProc (va_code_Store4 ()) ([va_Mod_mem_heaplet 0; va_Mod_mem]) (va_wp_Store4 dst_b) (va_wpProof_Store4 dst_b)) //-- //-- Carry_times_38 val va_code_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_code [@ "opaque_to_smt"] let va_code_Carry_times_38 tmp = (va_Block (va_CCons (va_code_Mov64 tmp (va_const_opr64 38)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_CNil ())))) val va_codegen_success_Carry_times_38 : tmp:va_operand_dst_opr64 -> Tot va_pbool [@ "opaque_to_smt"] let va_codegen_success_Carry_times_38 tmp = (va_pbool_and (va_codegen_success_Mov64 tmp (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp)) (va_ttrue ()))) val va_lemma_Carry_times_38 : va_b0:va_code -> va_s0:va_state -> tmp:va_operand_dst_opr64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_times_38 tmp) va_s0 /\ va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) /\ va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0))))) [@"opaque_to_smt"] let va_lemma_Carry_times_38 va_b0 va_s0 tmp = va_reveal_opaque (`%va_code_Carry_times_38) (va_code_Carry_times_38 tmp); let (va_old_s:va_state) = va_s0 in let (va_b1:va_codes) = va_get_block va_b0 in let (va_s3, va_fc3) = va_lemma_Mov64 (va_hd va_b1) va_s0 tmp (va_const_opr64 38) in let va_b3 = va_tl va_b1 in let (va_s4, va_fc4) = va_lemma_Cmovc64 (va_hd va_b3) va_s3 (va_op_dst_opr64_reg64 rRax) (va_coerce_dst_opr64_to_opr64 tmp) in let va_b4 = va_tl va_b3 in let (va_sM, va_f4) = va_lemma_empty_total va_s4 va_b4 in let va_f3 = va_lemma_merge_total va_b3 va_s3 va_fc4 va_s4 va_f4 va_sM in let va_fM = va_lemma_merge_total va_b1 va_s0 va_fc3 va_s3 va_f3 va_sM in (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_times_38 (tmp:va_operand_dst_opr64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_is_dst_dst_opr64 tmp va_s0 /\ va_get_ok va_s0 /\ (va_get_reg64 rRax va_s0 == 0 /\ tmp =!= Vale.X64.Machine_s.OReg #Vale.X64.Machine_s.nat64 #Vale.X64.Machine_s.reg_64 rRax /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_tmp:va_value_dst_opr64) (va_x_rax:nat64) . let va_sM = va_upd_reg64 rRax va_x_rax (va_upd_operand_dst_opr64 tmp va_x_tmp va_s0) in va_get_ok va_sM /\ (va_get_reg64 rRax va_sM == Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM)) `op_Multiply` 38 /\ va_eval_dst_opr64 va_sM tmp == 38) ==> va_k va_sM (()))) val va_wpProof_Carry_times_38 : tmp:va_operand_dst_opr64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_times_38 tmp va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_times_38 tmp va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_times_38 (va_code_Carry_times_38 tmp) va_s0 tmp in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_operand_dst_opr64 tmp va_sM va_s0)))); va_lemma_norm_mods ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_times_38 (tmp:va_operand_dst_opr64) : (va_quickCode unit (va_code_Carry_times_38 tmp)) = (va_QProc (va_code_Carry_times_38 tmp) ([va_Mod_reg64 rRax; va_mod_dst_opr64 tmp]) (va_wp_Carry_times_38 tmp) (va_wpProof_Carry_times_38 tmp)) //-- //-- Carry_pass #push-options "--z3rlimit 100" val va_code_Carry_pass : use_cf:bool -> offset:nat -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_pass use_cf offset = (va_Block (va_CCons (if use_cf then va_Block (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Add carry*38 to the original sum" ) (va_CCons (va_code_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_CNil ()))))))) else va_Block (va_CCons (va_code_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Fold the carry back into dst" ) (va_CNil ()))))) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_CNil ())))))))))))))))) val va_codegen_success_Carry_pass : use_cf:bool -> offset:nat -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_pass use_cf offset = (va_pbool_and (if use_cf then va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Add carry*38 to the original sum" ) (va_pbool_and (va_codegen_success_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_ttrue ())))))) else va_pbool_and (va_codegen_success_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Fold the carry back into dst" ) (va_ttrue ())))) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret) (va_ttrue ()))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_pass (va_mods:va_mods_t) (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 431 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods use_cf (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 433 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 434 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 435 column 23 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 437 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 438 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Add carry*38 to the original sum" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 439 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 440 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Xor64 (va_op_dst_opr64_reg64 rRcx) (va_op_opr64_reg64 rRcx)) (va_QEmpty (())))))))))) (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 444 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_IMul64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 445 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 446 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Fold the carry back into dst" ) (va_QEmpty (()))))))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 449 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 450 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 451 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR9) (8 + offset `op_Multiply` 8) Secret dst_b (1 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 452 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 453 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR10) (16 + offset `op_Multiply` 8) Secret dst_b (2 + offset)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 454 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_op_opr64_reg64 rRcx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 455 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR11) (24 + offset `op_Multiply` 8) Secret dst_b (3 + offset)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 456 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38) (let (sum:(va_int_at_least 0)) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) + carry_in `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 459 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum >= pow2_256)) (let (va_arg52:Vale.Def.Types_s.nat64) = carry_in in let (va_arg51:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg50:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg49:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg48:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg47:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg46:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg45:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg44:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 460 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_prime va_arg44 va_arg45 va_arg46 va_arg47 va_arg48 va_arg49 va_arg50 va_arg51 va_arg52 new_carry) (let (a0':nat64) = va_get_reg64 rR8 va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 463 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 464 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 465 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 466 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRdx)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 467 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (fun (va_s:va_state) _ -> va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 468 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rR8 va_s == a0' + new_carry `op_Multiply` 38) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 469 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_reg_opr64_reg64 rRdi) (va_op_reg_opr64_reg64 rR8) (0 + offset `op_Multiply` 8) Secret dst_b (0 + offset)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_pass : va_b0:va_code -> va_s0:va_state -> use_cf:bool -> offset:nat -> dst_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_pass use_cf offset) va_s0 /\ va_get_ok va_s0 /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (carry_in:nat64) = (if use_cf then (if Vale.X64.Decls.cf (va_get_flags va_s0) then 1 else 0) else va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))) [@"opaque_to_smt"] let va_lemma_Carry_pass va_b0 va_s0 use_cf offset dst_b = let (va_mods:va_mods_t) = [va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_pass va_mods use_cf offset dst_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_pass use_cf offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 393 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 421 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 422 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 423 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 424 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 426 column 106 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 428 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 429 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in adx_enabled /\ bmi2_enabled /\ carry_in `op_Multiply` 38 < pow2_63 /\ (~use_cf ==> va_get_reg64 rRcx va_s0 == 0 /\ va_get_reg64 rRdx va_s0 == 38) /\ (use_cf ==> Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ Vale.X64.Decls.validDstAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdi va_s0) dst_b (4 + offset) (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_mem:vale_heap) (va_x_rax:nat64) (va_x_rdx:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) (va_x_heap0:vale_heap) . let va_sM = va_upd_mem_heaplet 0 va_x_heap0 (va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRdx va_x_rdx (va_upd_reg64 rRax va_x_rax (va_upd_mem va_x_mem va_s0))))))))) in va_get_ok va_sM /\ (let (carry_in:nat64) = va_if use_cf (fun _ -> va_if (Vale.X64.Decls.cf (va_get_flags va_s0)) (fun _ -> 1) (fun _ -> 0)) (fun _ -> va_get_reg64 rRax va_s0) in let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) + va_mul_nat carry_in pow2_256) `op_Modulus` prime /\ Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1) /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) ==> va_k va_sM (()))) val va_wpProof_Carry_pass : use_cf:bool -> offset:nat -> dst_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_pass use_cf offset dst_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_pass use_cf offset dst_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_pass (va_code_Carry_pass use_cf offset) va_s0 use_cf offset dst_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_pass (use_cf:bool) (offset:nat) (dst_b:buffer64) : (va_quickCode unit (va_code_Carry_pass use_cf offset)) = (va_QProc (va_code_Carry_pass use_cf offset) ([va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRdx; va_Mod_reg64 rRax; va_Mod_mem]) (va_wp_Carry_pass use_cf offset dst_b) (va_wpProof_Carry_pass use_cf offset dst_b)) #pop-options //-- //-- Carry_wide #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Carry_wide offset = (va_Block (va_CCons (va_code_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Fast_mul1_add (offset `op_Multiply` 2)) (va_CCons (va_code_Carry_pass false offset) (va_CNil ())))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_wide offset = (va_pbool_and (va_codegen_success_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Fast_mul1_add (offset `op_Multiply` 2)) (va_pbool_and (va_codegen_success_Carry_pass false offset) (va_ttrue ()))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_wide (va_mods:va_mods_t) (offset:nat) (dst_b:buffer64) (inA_b:buffer64) : (va_quickCode unit (va_code_Carry_wide offset)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 525 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 526 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 528 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1_add (offset `op_Multiply` 2) inA_b) (fun (va_s:va_state) _ -> let (d0_mid:nat64) = va_get_reg64 rR8 va_s in let (d1_mid:nat64) = va_get_reg64 rR9 va_s in let (d2_mid:nat64) = va_get_reg64 rR10 va_s in let (d3_mid:nat64) = va_get_reg64 rR11 va_s in let (carry_mid:nat64) = va_get_reg64 rRax va_s in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 535 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false offset dst_b) (fun (va_s:va_state) _ -> let (d0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_s) in let (d1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_s) in let (d2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_s) in let (d3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_s) in let (va_arg35:Vale.Def.Types_s.nat64) = carry_mid in let (va_arg34:Vale.Def.Types_s.nat64) = d3_mid in let (va_arg33:Vale.Def.Types_s.nat64) = d2_mid in let (va_arg32:Vale.Def.Types_s.nat64) = d1_mid in let (va_arg31:Vale.Def.Types_s.nat64) = d0_mid in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 541 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_wide a0 a1 a2 a3 a4 a5 a6 a7 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 d0 d1 d2 d3) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Carry_wide va_b0 va_s0 offset dst_b inA_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Carry_wide va_mods offset dst_b inA_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_wide offset) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 472 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (0 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (1 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (2 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (3 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a4:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (4 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a5:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (5 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a6:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (6 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a7:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b (7 + offset `op_Multiply` 2) (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_eight a0 a1 a2 a3 a4 a5 a6 a7 in label va_range1 "***** POSTCONDITION NOT MET AT line 514 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b (0 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 515 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b (1 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 516 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b (2 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 517 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b (3 + offset) (va_get_mem_heaplet 0 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 518 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 520 column 36 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == a `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 522 column 78 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_sM) (va_get_reg64 rRdi va_sM) dst_b (4 + offset) (va_get_mem_layout va_sM) Secret) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 523 column 87 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer_specific dst_b (va_get_mem_heaplet 0 va_s0) (va_get_mem_heaplet 0 va_sM) (0 + offset) (4 + offset - 1))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Carry_wide offset dst_b inA_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_wide (va_code_Carry_wide offset) va_s0 offset dst_b inA_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Carry_sub_pass #push-options "--z3rlimit 600 --z3seed 2" val va_code_Carry_sub_pass : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Carry_sub_pass () = (va_Block (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 2: Substract carry*38 from the original difference" ) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_CCons (va_code_Newline ()) (va_CCons (va_code_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_CCons (va_code_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_CNil ()))))))))))))))))) val va_codegen_success_Carry_sub_pass : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Carry_sub_pass () = (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 2: Substract carry*38 from the original difference" ) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Newline ()) (va_pbool_and (va_codegen_success_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_pbool_and (va_codegen_success_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_ttrue ())))))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Carry_sub_pass (va_mods:va_mods_t) : (va_quickCode unit (va_code_Carry_sub_pass ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 634 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 636 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 637 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 638 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_times_38 (va_op_dst_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 640 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 641 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 2: Substract carry*38 from the original difference" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 642 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 643 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 644 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 645 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 647 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Newline ()) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 648 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 3: Fold the carry bit back in; guaranteed not to carry at this point" ) (fun (va_s:va_state) _ -> let (old_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_old_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 650 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38) (let (sum:int) = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_old_s) (va_get_reg64 rR9 va_old_s) (va_get_reg64 rR10 va_old_s) (va_get_reg64 rR11 va_old_s) - old_carry `op_Multiply` 38 in let (new_carry:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 653 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (new_carry == Vale.Curve25519.Fast_defs.bool_bit (sum < 0)) (let (va_arg37:Vale.Def.Types_s.nat64) = old_carry in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg32:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_old_s in let (va_arg31:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_old_s in let (va_arg30:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_old_s in let (va_arg29:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 654 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_carry_sub_prime va_arg29 va_arg30 va_arg31 va_arg32 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37 new_carry) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 657 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRax) (va_const_opr64 0)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 658 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Cmovc64 (va_op_dst_opr64_reg64 rRax) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 659 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_op_opr64_reg64 rRax)) (va_QEmpty (()))))))))))))))))))))) val va_lemma_Carry_sub_pass : va_b0:va_code -> va_s0:va_state -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Carry_sub_pass ()) va_s0 /\ va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0)))))))))) [@"opaque_to_smt"] let va_lemma_Carry_sub_pass va_b0 va_s0 = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok] in let va_qc = va_qcode_Carry_sub_pass va_mods in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Carry_sub_pass ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 613 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 632 column 114 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime)) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Carry_sub_pass (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.valid_cf (va_get_flags va_s0)) /\ (forall (va_x_rax:nat64) (va_x_rcx:nat64) (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 (va_upd_reg64 rRcx va_x_rcx (va_upd_reg64 rRax va_x_rax va_s0)))))) in va_get_ok va_sM /\ Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) `op_Modulus` prime == (Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s0) (va_get_reg64 rR9 va_s0) (va_get_reg64 rR10 va_s0) (va_get_reg64 rR11 va_s0) - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s0))) pow2_256) `op_Modulus` prime ==> va_k va_sM (()))) val va_wpProof_Carry_sub_pass : va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Carry_sub_pass va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Carry_sub_pass va_s0 va_k = let (va_sM, va_f0) = va_lemma_Carry_sub_pass (va_code_Carry_sub_pass ()) va_s0 in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM va_s0))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Carry_sub_pass () : (va_quickCode unit (va_code_Carry_sub_pass ())) = (va_QProc (va_code_Carry_sub_pass ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax]) va_wp_Carry_sub_pass va_wpProof_Carry_sub_pass) #pop-options //-- //-- Fast_add #push-options "--z3rlimit 600" val va_code_Fast_add : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_add () = (va_Block (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_CNil ())))))))))))))) val va_codegen_success_Fast_add : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_add () = (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_ttrue ()))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_add (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 706 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 707 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRdx) 0 Secret inB_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 inA_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 708 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Add64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 710 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRdx) 8 Secret inB_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 inA_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 711 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 713 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRdx) 16 Secret inB_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 inA_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 714 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 716 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRdx) 24 Secret inB_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 26 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 inA_b 3 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 717 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Adcx64Wrap (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRsi) 24 Secret)) (va_QEmpty (())))))))))))))))) val va_lemma_Fast_add : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_add ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_add va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_add va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_add ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 664 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 702 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in label va_range1 "***** POSTCONDITION NOT MET AT line 703 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d == a + b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 704 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_add (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in adx_enabled /\ bmi2_enabled /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) in d == a + b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_add : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_add inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_add inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_add (va_code_Fast_add ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_add (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_add ())) = (va_QProc (va_code_Fast_add ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_add inA_b inB_b) (va_wpProof_Fast_add inA_b inB_b)) #pop-options //-- //-- Fast_sub #push-options "--z3rlimit 600" val va_code_Fast_sub : va_dummy:unit -> Tot va_code [@ "opaque_to_smt" va_qattr] let va_code_Fast_sub () = (va_Block (va_CCons (va_code_Comment "Compute the raw substraction of f1-f2" ) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_CCons (va_code_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_CCons (va_code_Mem64_lemma ()) (va_CCons (va_code_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_CNil ()))))))))))))))) val va_codegen_success_Fast_sub : va_dummy:unit -> Tot va_pbool [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fast_sub () = (va_pbool_and (va_codegen_success_Comment "Compute the raw substraction of f1-f2" ) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_pbool_and (va_codegen_success_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret) (va_pbool_and (va_codegen_success_Mem64_lemma ()) (va_pbool_and (va_codegen_success_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (va_ttrue ())))))))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fast_sub (va_mods:va_mods_t) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 760 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw substraction of f1-f2" ) (fun (va_s:va_state) _ -> va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 761 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Arch.Types.xor_lemmas ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 764 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR8) (va_op_reg_opr64_reg64 rRsi) 0 Secret inA_b 0) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 25 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 inB_b 0 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 765 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sub64Wrap (va_op_dst_opr64_reg64 rR8) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 0 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 767 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR9) (va_op_reg_opr64_reg64 rRsi) 8 Secret inA_b 1) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 inB_b 1 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 768 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR9) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 8 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 770 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR10) (va_op_reg_opr64_reg64 rRsi) 16 Secret inA_b 2) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 inB_b 2 Secret) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 771 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR10) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 16 Secret)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 773 column 18 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Load64_buffer (va_op_heaplet_mem_heaplet 0) (va_op_dst_opr64_reg64 rR11) (va_op_reg_opr64_reg64 rRsi) 24 Secret inA_b 3) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 774 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mem64_lemma (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 inB_b 3 Secret) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 774 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Sbb64 (va_op_dst_opr64_reg64 rR11) (va_opr_code_Mem64 (va_op_heaplet_mem_heaplet 0) (va_op_reg64_reg64 rRdx) 24 Secret)) (fun (va_s:va_state) _ -> let (va_arg37:Vale.Curve25519.Fast_defs.bit) = Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s)) in let (va_arg36:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg35:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg34:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg33:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 776 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastUtil_helpers.lemma_sub a a0 a1 a2 a3 b b0 b1 b2 b3 va_arg33 va_arg34 va_arg35 va_arg36 va_arg37) (va_QEmpty (())))))))))))))))))) val va_lemma_Fast_sub : va_b0:va_code -> va_s0:va_state -> inA_b:buffer64 -> inB_b:buffer64 -> Ghost (va_state & va_fuel) (requires (va_require_total va_b0 (va_code_Fast_sub ()) va_s0 /\ va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret))) (ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) /\ va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0)))))))) [@"opaque_to_smt"] let va_lemma_Fast_sub va_b0 va_s0 inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok] in let va_qc = va_qcode_Fast_sub va_mods inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fast_sub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 720 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 756 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 757 column 55 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 758 column 22 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.valid_cf (va_get_flags va_sM))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_ok]) va_sM va_s0; (va_sM, va_fM) [@ va_qattr] let va_wp_Fast_sub (inA_b:buffer64) (inB_b:buffer64) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 = (va_get_ok va_s0 /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRsi va_s0) inA_b 4 (va_get_mem_layout va_s0) Secret /\ Vale.X64.Decls.validSrcAddrs64 (va_get_mem_heaplet 0 va_s0) (va_get_reg64 rRdx va_s0) inB_b 4 (va_get_mem_layout va_s0) Secret) /\ (forall (va_x_r8:nat64) (va_x_r9:nat64) (va_x_r10:nat64) (va_x_r11:nat64) (va_x_efl:Vale.X64.Flags.t) . let va_sM = va_upd_flags va_x_efl (va_upd_reg64 rR11 va_x_r11 (va_upd_reg64 rR10 va_x_r10 (va_upd_reg64 rR9 va_x_r9 (va_upd_reg64 rR8 va_x_r8 va_s0)))) in va_get_ok va_sM /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem_heaplet 0 va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem_heaplet 0 va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem_heaplet 0 va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem_heaplet 0 va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem_heaplet 0 va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem_heaplet 0 va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem_heaplet 0 va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem_heaplet 0 va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in let d = Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_sM) (va_get_reg64 rR9 va_sM) (va_get_reg64 rR10 va_sM) (va_get_reg64 rR11 va_sM) in d - va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_sM))) pow2_256 == a - b /\ Vale.X64.Decls.valid_cf (va_get_flags va_sM)) ==> va_k va_sM (()))) val va_wpProof_Fast_sub : inA_b:buffer64 -> inB_b:buffer64 -> va_s0:va_state -> va_k:(va_state -> unit -> Type0) -> Ghost (va_state & va_fuel & unit) (requires (va_t_require va_s0 /\ va_wp_Fast_sub inA_b inB_b va_s0 va_k)) (ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_s0 va_k ((va_sM, va_f0, va_g)))) [@"opaque_to_smt"] let va_wpProof_Fast_sub inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fast_sub (va_code_Fast_sub ()) va_s0 inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_ok va_sM va_s0))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) [@ "opaque_to_smt" va_qattr] let va_quick_Fast_sub (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fast_sub ())) = (va_QProc (va_code_Fast_sub ()) ([va_Mod_flags; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8]) (va_wp_Fast_sub inA_b inB_b) (va_wpProof_Fast_sub inA_b inB_b)) #pop-options //-- //-- Fadd [@ "opaque_to_smt" va_qattr] let va_code_Fadd () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Comment "Compute the raw addition of f1 + f2" ) (va_CCons (va_code_Fast_add ()) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Carry_pass true 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ())))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Comment "Compute the raw addition of f1 + f2" ) (va_pbool_and (va_codegen_success_Fast_add ()) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Carry_pass true 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ()))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 836 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 841 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Compute the raw addition of f1 + f2" ) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 842 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_add inA_b inB_b) (fun (va_s:va_state) _ -> let (va_arg26:prop) = Vale.Curve25519.Fast_defs.pow2_five (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) == Vale.Curve25519.Fast_defs.pow2_four (va_get_reg64 rR8 va_s) (va_get_reg64 rR9 va_s) (va_get_reg64 rR10 va_s) (va_get_reg64 rR11 va_s) + va_mul_nat (Vale.Curve25519.Fast_defs.bool_bit (Vale.X64.Decls.cf (va_get_flags va_s))) pow2_256 in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 843 column 21 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> assert_by_tactic va_arg26 int_canon) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 846 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 847 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass true 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 849 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))) [@"opaque_to_smt"] let va_lemma_Fadd va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 782 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 827 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 828 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 829 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 830 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 831 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 832 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 834 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd (va_code_Fadd ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fadd_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fadd_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fadd ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fadd_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fadd ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fadd_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fadd_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 923 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 926 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 927 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 929 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 930 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 931 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 934 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fadd dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 936 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 938 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 939 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fadd_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fadd_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fadd_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 852 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 879 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 880 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 881 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 882 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 884 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 885 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 886 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 887 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 889 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 890 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 891 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 892 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 894 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 895 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 896 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 898 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a + b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 904 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 906 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 907 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 908 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 909 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 910 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 911 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 912 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 913 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 914 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 915 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 916 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 917 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 918 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 920 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fadd_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fadd_stdcall (va_code_Fadd_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub [@ "opaque_to_smt" va_qattr] let va_code_Fsub () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_sub ()) (va_CCons (va_code_Carry_sub_pass ()) (va_CCons (va_code_Store4 ()) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_sub ()) (va_pbool_and (va_codegen_success_Carry_sub_pass ()) (va_pbool_and (va_codegen_success_Store4 ()) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 997 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 inB_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1002 column 13 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_sub inA_b inB_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1003 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_sub_pass ()) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1004 column 11 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Store4 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1006 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))) [@"opaque_to_smt"] let va_lemma_Fsub va_b0 va_s0 dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub va_mods dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 943 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (b0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in let (b1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in let (b2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in let (b3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in let (b:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 988 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 989 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 990 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 991 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 992 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 993 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 995 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub (va_code_Fsub ()) va_s0 dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0)))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fsub_stdcall [@ "opaque_to_smt" va_qattr] let va_code_Fsub_stdcall win = (va_Block (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ())))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fsub ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))) else va_Block (va_CNil ())) (va_CNil ()))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fsub_stdcall win = (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ()))))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fsub ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())) else va_ttrue ()) (va_ttrue ())))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fsub_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_b:buffer64) : (va_quickCode unit (va_code_Fsub_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s) (fun _ -> va_get_reg64 rRdx va_s) in va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1080 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1083 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1084 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1086 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1087 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1088 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (())))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1091 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fsub dst_b inA_b inB_b) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1093 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1095 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1096 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QEmpty (())))))) [@"opaque_to_smt"] let va_lemma_Fsub_stdcall va_b0 va_s0 win dst_b inA_b inB_b = let (va_mods:va_mods_t) = [va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fsub_stdcall va_mods win dst_b inA_b inB_b in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fsub_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1009 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in let (inB_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rR8 va_s0) (fun _ -> va_get_reg64 rRdx va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1036 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1037 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1038 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1039 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1041 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b0 = Vale.X64.Decls.buffer64_read inB_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1042 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b1 = Vale.X64.Decls.buffer64_read inB_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1043 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b2 = Vale.X64.Decls.buffer64_read inB_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1044 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b3 = Vale.X64.Decls.buffer64_read inB_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1046 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1047 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1048 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1049 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1051 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1052 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let b = Vale.Curve25519.Fast_defs.pow2_four b0 b1 b2 b3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1053 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1055 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (a - b) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1061 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1063 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1064 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1065 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1066 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1067 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1068 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1069 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1070 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1071 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1072 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1073 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1074 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1075 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1077 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0)))))))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fsub_stdcall win dst_b inA_b inB_b va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fsub_stdcall (va_code_Fsub_stdcall win) va_s0 win dst_b inA_b inB_b in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_stackTaint va_sM (va_update_stack va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_flags va_sM (va_update_reg64 rR15 va_sM (va_update_reg64 rR14 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRsp va_sM (va_update_reg64 rRbp va_sM (va_update_reg64 rRdi va_sM (va_update_reg64 rRsi va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))))))))))); va_lemma_norm_mods ([va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) //-- //-- Fmul1 #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1 () = (va_Block (va_CCons (va_code_CreateHeaplets ()) (va_CCons (va_code_Fast_mul1 0) (va_CCons (va_code_LargeComment "Wrap the result back into the field" ) (va_CCons (va_code_Comment "Step 1: Compute carry*38" ) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_CCons (va_code_Carry_pass false 0) (va_CCons (va_code_DestroyHeaplets ()) (va_CNil ()))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1 () = (va_pbool_and (va_codegen_success_CreateHeaplets ()) (va_pbool_and (va_codegen_success_Fast_mul1 0) (va_pbool_and (va_codegen_success_LargeComment "Wrap the result back into the field" ) (va_pbool_and (va_codegen_success_Comment "Step 1: Compute carry*38" ) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_pbool_and (va_codegen_success_Carry_pass false 0) (va_pbool_and (va_codegen_success_DestroyHeaplets ()) (va_ttrue ())))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1 (va_mods:va_mods_t) (dst_b:buffer64) (inA_b:buffer64) (inB:nat64) : (va_quickCode unit (va_code_Fmul1 ())) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1150 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_CreateHeaplets ([declare_buffer64 inA_b 0 Secret Immutable; declare_buffer64 dst_b 0 Secret Mutable])) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1154 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fast_mul1 0 inA_b) (fun (va_s:va_state) _ -> let (va_arg28:Vale.Def.Types_s.nat64) = va_get_reg64 rRax va_s in let (va_arg27:Vale.Def.Types_s.nat64) = va_get_reg64 rR11 va_s in let (va_arg26:Vale.Def.Types_s.nat64) = va_get_reg64 rR10 va_s in let (va_arg25:Vale.Def.Types_s.nat64) = va_get_reg64 rR9 va_s in let (va_arg24:Vale.Def.Types_s.nat64) = va_get_reg64 rR8 va_s in let (va_arg23:Vale.Def.Types_s.nat64) = va_get_reg64 rRdx va_old_s in va_qPURE va_range1 "***** PRECONDITION NOT MET AT line 1155 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (fun (_:unit) -> Vale.Curve25519.FastHybrid_helpers.lemma_fmul a0 a1 a2 a3 va_arg23 va_arg24 va_arg25 va_arg26 va_arg27 va_arg28) (va_qAssert va_range1 "***** PRECONDITION NOT MET AT line 1156 column 5 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRax va_s `op_Multiply` 38 < pow2_63) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1157 column 17 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_LargeComment "Wrap the result back into the field" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1158 column 12 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Comment "Step 1: Compute carry*38" ) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1159 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_const_opr64 38)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1160 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Carry_pass false 0 dst_b) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1163 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_DestroyHeaplets ()) (va_QEmpty (())))))))))))) [@"opaque_to_smt"] let va_lemma_Fmul1 va_b0 va_s0 dst_b inA_b inB = let (va_mods:va_mods_t) = [va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem] in let va_qc = va_qcode_Fmul1 va_mods dst_b inA_b inB in let (va_sM, va_fM, va_g) = va_wp_sound_code_norm (va_code_Fmul1 ()) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1100 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let (a0:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in let (a1:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in let (a2:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in let (a3:Vale.Def.Types_s.nat64) = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in let (a:Prims.nat) = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1141 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1142 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1143 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1144 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1145 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1146 column 40 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == va_mul_nat a (va_get_reg64 rRdx va_s0) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1148 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem]) va_sM va_s0; (va_sM, va_fM) [@"opaque_to_smt"] let va_wpProof_Fmul1 dst_b inA_b inB va_s0 va_k = let (va_sM, va_f0) = va_lemma_Fmul1 (va_code_Fmul1 ()) va_s0 dst_b inA_b inB in va_lemma_upd_update va_sM; assert (va_state_eq va_sM (va_update_flags va_sM (va_update_mem_layout va_sM (va_update_mem_heaplet 0 va_sM (va_update_reg64 rR13 va_sM (va_update_reg64 rRbx va_sM (va_update_reg64 rR11 va_sM (va_update_reg64 rR10 va_sM (va_update_reg64 rR9 va_sM (va_update_reg64 rR8 va_sM (va_update_reg64 rRdx va_sM (va_update_reg64 rRcx va_sM (va_update_reg64 rRax va_sM (va_update_ok va_sM (va_update_mem va_sM va_s0))))))))))))))); va_lemma_norm_mods ([va_Mod_flags; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_reg64 rR13; va_Mod_reg64 rRbx; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRax; va_Mod_mem]) va_sM va_s0; let va_g = () in (va_sM, va_f0, va_g) #pop-options //-- //-- Fmul1_stdcall #push-options "--z3rlimit 600" [@ "opaque_to_smt" va_qattr] let va_code_Fmul1_stdcall win = (va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_CCons (if win then va_Block (va_CCons (va_code_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_CCons (va_code_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_CNil ()))))) else va_Block (va_CNil ())) (va_CCons (va_code_Fmul1 ()) (va_CCons (if win then va_Block (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_CNil ())) else va_Block (va_CNil ())) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_CCons (va_code_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_CNil ()))))))))))) [@ "opaque_to_smt" va_qattr] let va_codegen_success_Fmul1_stdcall win = (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_pbool_and (va_codegen_success_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_ttrue ())))) else va_ttrue ()) (va_pbool_and (va_codegen_success_Fmul1 ()) (va_pbool_and (if win then va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_ttrue ()) else va_ttrue ()) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_pbool_and (va_codegen_success_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_ttrue ())))))))))) [@ "opaque_to_smt" va_qattr] let va_qcode_Fmul1_stdcall (va_mods:va_mods_t) (win:bool) (dst_b:buffer64) (inA_b:buffer64) (inB_in:nat64) : (va_quickCode unit (va_code_Fmul1_stdcall win)) = (qblock va_mods (fun (va_s:va_state) -> let (va_old_s:va_state) = va_s in let (dst_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRcx va_s) (fun _ -> va_get_reg64 rRdi va_s) in let (inA_in:(va_int_range 0 18446744073709551615)) = va_if win (fun _ -> va_get_reg64 rRdx va_s) (fun _ -> va_get_reg64 rRsi va_s) in va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1233 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRdi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1234 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rR13)) (va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1235 column 16 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRbx)) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1238 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1240 column 20 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Push_Secret (va_op_reg_opr64_reg64 rRsi)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1241 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdi) (va_op_opr64_reg64 rRcx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1242 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRsi) (va_op_opr64_reg64 rRdx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1243 column 14 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Mov64 (va_op_dst_opr64_reg64 rRdx) (va_op_opr64_reg64 rR8)) (va_QEmpty (()))))))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1246 column 10 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Fmul1 dst_b inA_b inB_in) (fun (va_s:va_state) _ -> va_QBind va_range1 "***** PRECONDITION NOT MET AT line 1248 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_qInlineIf va_mods win (qblock va_mods (fun (va_s:va_state) -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1250 column 19 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRsi)) (va_QEmpty (())))) (qblock va_mods (fun (va_s:va_state) -> va_QEmpty (())))) (fun (va_s:va_state) va_g -> va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1253 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRbx)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1254 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rR13)) (va_QSeq va_range1 "***** PRECONDITION NOT MET AT line 1255 column 15 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_quick_Pop_Secret (va_op_dst_opr64_reg64 rRdi)) (va_QEmpty (()))))))))))))
{ "checked_file": "/", "dependencies": [ "Vale.X64.State.fsti.checked", "Vale.X64.QuickCodes.fsti.checked", "Vale.X64.QuickCode.fst.checked", "Vale.X64.Memory.fsti.checked", "Vale.X64.Machine_s.fst.checked", "Vale.X64.InsStack.fsti.checked", "Vale.X64.InsMem.fsti.checked", "Vale.X64.InsBasic.fsti.checked", "Vale.X64.Flags.fsti.checked", "Vale.X64.Decls.fsti.checked", "Vale.X64.CPU_Features_s.fst.checked", "Vale.Def.Types_s.fst.checked", "Vale.Curve25519.FastUtil_helpers.fsti.checked", "Vale.Curve25519.FastHybrid_helpers.fsti.checked", "Vale.Curve25519.Fast_lemmas_external.fsti.checked", "Vale.Curve25519.Fast_defs.fst.checked", "Vale.Arch.Types.fsti.checked", "prims.fst.checked", "FStar.Tactics.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked" ], "interface_file": true, "source_file": "Vale.Curve25519.X64.FastHybrid.fst" }
[ { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastUtil_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.FastHybrid_helpers", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_lemmas_external", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "FStar.Tactics", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.CPU_Features_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.Fast_defs", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCodes", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.QuickCode", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsStack", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsMem", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.InsBasic", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Decls", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.State", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Stack_i", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Memory", "short_module": null }, { "abbrev": false, "full_module": "Vale.X64.Machine_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.HeapImpl", "short_module": null }, { "abbrev": false, "full_module": "Vale.Arch.Types", "short_module": null }, { "abbrev": false, "full_module": "Vale.Def.Types_s", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "Vale.Curve25519.X64", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 0, "max_fuel": 1, "max_ifuel": 1, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": true, "smtencoding_l_arith_repr": "native", "smtencoding_nl_arith_repr": "wrapped", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [ "smt.arith.nl=false", "smt.QI.EAGER_THRESHOLD=100", "smt.CASE_SPLIT=3" ], "z3refresh": false, "z3rlimit": 600, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
va_b0: Vale.X64.Decls.va_code -> va_s0: Vale.X64.Decls.va_state -> win: Prims.bool -> dst_b: Vale.X64.Memory.buffer64 -> inA_b: Vale.X64.Memory.buffer64 -> inB_in: Vale.X64.Memory.nat64 -> Prims.Ghost (Vale.X64.Decls.va_state * Vale.X64.Decls.va_fuel)
Prims.Ghost
[]
[]
[ "Vale.X64.Decls.va_code", "Vale.X64.Decls.va_state", "Prims.bool", "Vale.X64.Memory.buffer64", "Vale.X64.Memory.nat64", "Vale.X64.QuickCodes.fuel", "Prims.unit", "FStar.Pervasives.Native.Mktuple2", "Vale.X64.Decls.va_fuel", "Vale.X64.QuickCode.va_lemma_norm_mods", "Prims.Cons", "Vale.X64.QuickCode.mod_t", "Vale.X64.QuickCode.va_Mod_stackTaint", "Vale.X64.QuickCode.va_Mod_stack", "Vale.X64.QuickCode.va_Mod_mem_layout", "Vale.X64.QuickCode.va_Mod_mem_heaplet", "Vale.X64.QuickCode.va_Mod_flags", "Vale.X64.QuickCode.va_Mod_reg64", "Vale.X64.Machine_s.rR15", "Vale.X64.Machine_s.rR14", "Vale.X64.Machine_s.rR13", "Vale.X64.Machine_s.rR11", "Vale.X64.Machine_s.rR10", "Vale.X64.Machine_s.rR9", "Vale.X64.Machine_s.rR8", "Vale.X64.Machine_s.rRsp", "Vale.X64.Machine_s.rRbp", "Vale.X64.Machine_s.rRdi", "Vale.X64.Machine_s.rRsi", "Vale.X64.Machine_s.rRdx", "Vale.X64.Machine_s.rRcx", "Vale.X64.Machine_s.rRbx", "Vale.X64.Machine_s.rRax", "Vale.X64.QuickCode.va_Mod_ok", "Vale.X64.QuickCode.va_Mod_mem", "Prims.Nil", "FStar.Pervasives.assert_norm", "Prims.eq2", "Prims.list", "Vale.X64.QuickCode.__proj__QProc__item__mods", "Vale.Curve25519.X64.FastHybrid.va_code_Fmul1_stdcall", "FStar.Pervasives.Native.tuple2", "FStar.Pervasives.Native.tuple3", "Vale.X64.State.vale_state", "Vale.X64.QuickCodes.va_wp_sound_code_norm", "Prims.l_and", "Vale.X64.QuickCodes.label", "Vale.X64.QuickCodes.va_range1", "Prims.b2t", "Vale.X64.Decls.va_get_ok", "Prims.int", "Prims.op_Modulus", "Vale.Curve25519.Fast_defs.prime", "Vale.X64.Decls.va_mul_nat", "Vale.X64.Decls.modifies_buffer", "Vale.X64.Decls.va_get_mem", "Prims.l_imp", "Vale.Def.Types_s.nat64", "Vale.X64.Decls.va_get_reg64", "Prims.l_not", "Prims.nat", "Vale.Curve25519.Fast_defs.pow2_four", "Vale.Def.Words_s.nat64", "Vale.X64.Decls.buffer64_read", "Vale.X64.Decls.va_int_range", "Vale.X64.Decls.va_if", "Vale.X64.QuickCode.quickCode", "Vale.Curve25519.X64.FastHybrid.va_qcode_Fmul1_stdcall" ]
[]
false
false
false
false
false
let va_lemma_Fmul1_stdcall va_b0 va_s0 win dst_b inA_b inB_in =
let va_mods:va_mods_t = [ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ] in let va_qc = va_qcode_Fmul1_stdcall va_mods win dst_b inA_b inB_in in let va_sM, va_fM, va_g = va_wp_sound_code_norm (va_code_Fmul1_stdcall win) va_qc va_s0 (fun va_s0 va_sM va_g -> let () = va_g in label va_range1 "***** POSTCONDITION NOT MET AT line 1166 column 1 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_ok va_sM) /\ (let dst_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRcx va_s0) (fun _ -> va_get_reg64 rRdi va_s0) in let inA_in:(va_int_range 0 18446744073709551615) = va_if win (fun _ -> va_get_reg64 rRdx va_s0) (fun _ -> va_get_reg64 rRsi va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1195 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a0 = Vale.X64.Decls.buffer64_read inA_b 0 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1196 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a1 = Vale.X64.Decls.buffer64_read inA_b 1 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1197 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a2 = Vale.X64.Decls.buffer64_read inA_b 2 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1198 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a3 = Vale.X64.Decls.buffer64_read inA_b 3 (va_get_mem va_s0) in label va_range1 "***** POSTCONDITION NOT MET AT line 1200 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d0 = Vale.X64.Decls.buffer64_read dst_b 0 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1201 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d1 = Vale.X64.Decls.buffer64_read dst_b 1 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1202 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d2 = Vale.X64.Decls.buffer64_read dst_b 2 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1203 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d3 = Vale.X64.Decls.buffer64_read dst_b 3 (va_get_mem va_sM) in label va_range1 "***** POSTCONDITION NOT MET AT line 1205 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let a = Vale.Curve25519.Fast_defs.pow2_four a0 a1 a2 a3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1206 column 9 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (let d = Vale.Curve25519.Fast_defs.pow2_four d0 d1 d2 d3 in label va_range1 "***** POSTCONDITION NOT MET AT line 1208 column 47 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (d `op_Modulus` prime == (va_mul_nat a inB_in) `op_Modulus` prime) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1214 column 46 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (Vale.X64.Decls.modifies_buffer dst_b (va_get_mem va_s0) (va_get_mem va_sM)) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1216 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1217 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1218 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRdi va_sM == va_get_reg64 rRdi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1219 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsi va_sM == va_get_reg64 rRsi va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1220 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1221 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1222 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1223 column 33 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1224 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbx va_sM == va_get_reg64 rRbx va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1225 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rRbp va_sM == va_get_reg64 rRbp va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1226 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR13 va_sM == va_get_reg64 rR13 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1227 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR14 va_sM == va_get_reg64 rR14 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1228 column 34 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (~win ==> va_get_reg64 rR15 va_sM == va_get_reg64 rR15 va_s0) /\ label va_range1 "***** POSTCONDITION NOT MET AT line 1230 column 24 of file /home/gebner/fstar_dataset/projects/hacl-star/vale/code/thirdPartyPorts/rfc7748/curve25519/x64/Vale.Curve25519.X64.FastHybrid.vaf *****" (va_get_reg64 rRsp va_sM == va_get_reg64 rRsp va_s0))))))))))))) in assert_norm (va_qc.mods == va_mods); va_lemma_norm_mods ([ va_Mod_stackTaint; va_Mod_stack; va_Mod_mem_layout; va_Mod_mem_heaplet 0; va_Mod_flags; va_Mod_reg64 rR15; va_Mod_reg64 rR14; va_Mod_reg64 rR13; va_Mod_reg64 rR11; va_Mod_reg64 rR10; va_Mod_reg64 rR9; va_Mod_reg64 rR8; va_Mod_reg64 rRsp; va_Mod_reg64 rRbp; va_Mod_reg64 rRdi; va_Mod_reg64 rRsi; va_Mod_reg64 rRdx; va_Mod_reg64 rRcx; va_Mod_reg64 rRbx; va_Mod_reg64 rRax; va_Mod_ok; va_Mod_mem ]) va_sM va_s0; (va_sM, va_fM)
false
Hacl.Spec.Curve25519.Field64.fst
Hacl.Spec.Curve25519.Field64.lemma_carry_pass_store_first
val lemma_carry_pass_store_first: f:CC.felem -> Lemma (let out = carry_pass_store f in SD.bn_v out % prime == SD.bn_v f % prime /\ SD.bn_v out < prime + 38)
val lemma_carry_pass_store_first: f:CC.felem -> Lemma (let out = carry_pass_store f in SD.bn_v out % prime == SD.bn_v f % prime /\ SD.bn_v out < prime + 38)
let lemma_carry_pass_store_first f = let out = carry_pass_store f in let top_bit = f.[3] >>. 63ul in lemma_carry_pass_store0 f; assert (SD.bn_v out == SD.bn_v f - prime * v top_bit); Lemmas.lemma_carry_pass_store_f3 f
{ "file_name": "code/curve25519/Hacl.Spec.Curve25519.Field64.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 36, "end_line": 83, "start_col": 0, "start_line": 78 }
module Hacl.Spec.Curve25519.Field64 open FStar.Mul open Lib.Sequence open Lib.IntTypes open Spec.Curve25519 open Hacl.Spec.Curve25519.Field64.Definition module Lemmas = Hacl.Spec.Curve25519.Field64.Lemmas module CC = Hacl.Spec.Curve25519.Field64.Core module SD = Hacl.Spec.Bignum.Definitions module SB = Hacl.Spec.Bignum module SL = Hacl.Spec.Bignum.Lib #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" inline_for_extraction noextract val carry_pass_store: f:CC.felem -> CC.felem let carry_pass_store f = let top_bit = f.[3] >>. 63ul in let f3' = f.[3] &. u64 0x7fffffffffffffff in let r0 = f.[3] <- f3' in let (c, r1) = CC.add1 r0 (u64 19 *! top_bit) in r1 val lemma_carry_pass_store0: f:CC.felem -> Lemma (let out = carry_pass_store f in let top_bit = f.[3] >>. 63ul in SD.bn_v out == SD.bn_v f - prime * v top_bit /\ SD.bn_v out % prime == SD.bn_v f % prime) //SD.bn_v out <= pow2 255 + 18) let lemma_carry_pass_store0 f = let top_bit = f.[3] >>. 63ul in let f3' = f.[3] &. u64 0x7fffffffffffffff in Lemmas.lemma_carry_pass_store_f3 f; let r0 = f.[3] <- f3' in SD.bn_upd_eval f f3' 3; assert (SD.bn_v r0 == SD.bn_v f - v f.[3] * pow2 (3 * 64) + v f3' * pow2 (3 * 64)); calc (==) { SD.bn_v f - v f.[3] * pow2 (3 * 64) + v f3' * pow2 (3 * 64); (==) { } SD.bn_v f - (v top_bit * pow2 63 + v f3') * pow2 (3 * 64) + v f3' * pow2 (3 * 64); (==) { Math.Lemmas.distributivity_add_left (v top_bit * pow2 63) (v f3') (pow2 (3 * 64)) } SD.bn_v f - (v top_bit * pow2 63) * pow2 (3 * 64); (==) { Math.Lemmas.paren_mul_right (v top_bit) (pow2 63) (pow2 (3 * 64)); Math.Lemmas.pow2_plus 63 (3 * 64) } SD.bn_v f - v top_bit * pow2 255; }; assert (SD.bn_v r0 + v top_bit * pow2 255 == SD.bn_v f); let (c, r1) = CC.add1 r0 (u64 19 *! top_bit) in assert (SD.bn_v r1 + v c * pow2 256 == SD.bn_v r0 + 19 * v top_bit); SD.bn_eval_bound f 4; Lemmas.carry_pass_store_bound (SD.bn_v f) (v top_bit) (SD.bn_v r0) (SD.bn_v r1) (v c); calc (==) { //SD.bn_v r1 % prime == (SD.bn_v r0 + 19 * v top_bit) % prime; (==) { } (SD.bn_v f - v top_bit * pow2 255 + 19 * v top_bit) % prime; (==) { Lemmas.lemma_mul_pow255_add (SD.bn_v f - v top_bit * pow2 255) (v top_bit) } (SD.bn_v f - v top_bit * pow2 255 + v top_bit * pow2 255) % prime; (==) { } SD.bn_v f % prime; } val lemma_carry_pass_store_first: f:CC.felem -> Lemma (let out = carry_pass_store f in SD.bn_v out % prime == SD.bn_v f % prime /\ SD.bn_v out < prime + 38)
{ "checked_file": "/", "dependencies": [ "Spec.Curve25519.fst.checked", "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Curve25519.Field64.Lemmas.fst.checked", "Hacl.Spec.Curve25519.Field64.Definition.fst.checked", "Hacl.Spec.Curve25519.Field64.Core.fst.checked", "Hacl.Spec.Bignum.Lib.fst.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Hacl.Spec.Curve25519.Field64.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Lib", "short_module": "SL" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "SB" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": "SD" }, { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.Field64.Core", "short_module": "CC" }, { "abbrev": true, "full_module": "Hacl.Spec.Curve25519.Field64.Lemmas", "short_module": "Lemmas" }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519.Field64.Definition", "short_module": null }, { "abbrev": false, "full_module": "Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Curve25519", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
f: Hacl.Spec.Curve25519.Field64.Core.felem -> FStar.Pervasives.Lemma (ensures (let out = Hacl.Spec.Curve25519.Field64.carry_pass_store f in Hacl.Spec.Bignum.Definitions.bn_v out % Spec.Curve25519.prime == Hacl.Spec.Bignum.Definitions.bn_v f % Spec.Curve25519.prime /\ Hacl.Spec.Bignum.Definitions.bn_v out < Spec.Curve25519.prime + 38))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Curve25519.Field64.Core.felem", "Hacl.Spec.Curve25519.Field64.Lemmas.lemma_carry_pass_store_f3", "Prims.unit", "Prims._assert", "Prims.eq2", "Prims.int", "Hacl.Spec.Bignum.Definitions.bn_v", "Lib.IntTypes.U64", "Prims.op_Subtraction", "FStar.Mul.op_Star", "Spec.Curve25519.prime", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Hacl.Spec.Curve25519.Field64.lemma_carry_pass_store0", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Greater_Greater_Dot", "Lib.Sequence.op_String_Access", "Hacl.Spec.Bignum.Definitions.limb", "FStar.UInt32.__uint_to_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Curve25519.Field64.carry_pass_store" ]
[]
true
false
true
false
false
let lemma_carry_pass_store_first f =
let out = carry_pass_store f in let top_bit = f.[ 3 ] >>. 63ul in lemma_carry_pass_store0 f; assert (SD.bn_v out == SD.bn_v f - prime * v top_bit); Lemmas.lemma_carry_pass_store_f3 f
false
LowParse.SLow.BitVector.fst
LowParse.SLow.BitVector.serialize32_bounded_bv
val serialize32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: serializer32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (serializer32 (serialize_bounded_bv min max hs))
val serialize32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: serializer32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (serializer32 (serialize_bounded_bv min max hs))
let serialize32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: serializer32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (serializer32 (serialize_bounded_bv min max hs)) = serialize32_dtuple2 hs32 (fun (x: bounded_int32 min max) -> serialize32_weaken (parse_bounded_bv_payload_kind min max) (serialize32_bv (U32.v x)))
{ "file_name": "src/lowparse/LowParse.SLow.BitVector.fst", "git_rev": "00217c4a89f5ba56002ba9aa5b4a9d5903bfe9fa", "git_url": "https://github.com/project-everest/everparse.git", "project_name": "everparse" }
{ "end_col": 125, "end_line": 134, "start_col": 0, "start_line": 124 }
module LowParse.SLow.BitVector include LowParse.Spec.BitVector (* TODO: this module is NOT intended to be extracted to C yet. However, OCaml extraction should work. *) open LowParse.SLow.Combinators open LowParse.SLow.Int open LowParse.SLow.BoundedInt let parse32_bv8 : parser32 parse_bv8 = parse32_synth' _ synth_bv8 parse32_u8 () let serialize32_bv8 : serializer32 serialize_bv8 = serialize32_synth _ synth_bv8 _ serialize32_u8 synth_bv8_recip (fun x -> synth_bv8_recip x) () let size32_bv8 : size32 serialize_bv8 = size32_constant serialize_bv8 1ul () let rec parse32_byte_bv (n: nat) : Tot (parser32 (parse_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then parse32_ret Seq.empty else parse32_synth' _ (synth_byte_bv (n - 1)) (parse32_bv8 `parse32_nondep_then` parse32_byte_bv (n - 1)) () module BV = FStar.BitVector let rec serialize32_byte_bv (n: nat { n < 4294967296 }) : Tot (serializer32 (serialize_byte_bv n)) = parse_byte_bv_kind_eq n; if n = 0 then serialize32_ret Seq.empty (fun (x: BV.bv_t 0) -> assert (x `Seq.equal` Seq.empty)) else serialize32_synth _ (synth_byte_bv (n - 1)) _ (serialize32_bv8 `serialize32_nondep_then` serialize32_byte_bv (n - 1)) (synth_byte_bv_recip (n - 1)) (fun x -> synth_byte_bv_recip (n - 1) x) () module U32 = FStar.UInt32 let size32_byte_bv (n: nat { n < 4294967296 }) : Tot (size32 (serialize_byte_bv n)) = size32_constant _ (U32.uint_to_t n) () let parse32_extra_bv8 (n: nat) : Tot (parser32 (parse_extra_bv8 n)) = parse32_synth' _ (synth_extra_bv8 n) (parse32_filter parse32_u8 (extra_bytes_prop n) (fun x -> extra_bytes_prop n x)) () let serialize32_extra_bv8 (n: nat) : Tot (serializer32 (serialize_extra_bv8 n)) = serialize32_synth _ (synth_extra_bv8 n) _ (serialize32_filter serialize32_u8 (extra_bytes_prop n)) (synth_extra_bv8_recip n) (fun x -> synth_extra_bv8_recip n x) () let size32_extra_bv8 (n: nat) : Tot (size32 (serialize_extra_bv8 n)) = size32_constant _ 1ul () let parse32_bv (n: nat) : Tot (parser32 (parse_bv n)) = if n % 8 = 0 then parse32_byte_bv (n / 8) else parse32_synth' _ (synth_bv n) (parse32_extra_bv8 n `parse32_nondep_then` parse32_byte_bv (n / 8)) () let serialize32_bv (n: nat { n / 8 < 4294967295 }) : Tot (serializer32 (serialize_bv n)) = if n % 8 = 0 then serialize32_byte_bv (n / 8) else serialize32_synth _ (synth_bv n) _ (serialize32_extra_bv8 n `serialize32_nondep_then` serialize32_byte_bv (n / 8)) (synth_bv_recip n) (fun x -> synth_bv_recip n x) () let size32_bv (n: nat { n / 8 < 4294967295 }) : Tot (size32 (serialize_bv n)) = size32_constant _ (if n % 8 = 0 then U32.uint_to_t (n / 8) else U32.uint_to_t (1 + n / 8)) () let parse32_bounded_bv (min: nat) (max: nat { min <= max }) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (hp32: parser32 hp) : Tot (parser32 (parse_bounded_bv min max hp)) = parse32_dtuple2 hp32 (fun (x: bounded_int32 min max) -> parse32_weaken (parse_bounded_bv_payload_kind min max) (parse32_bv (U32.v x))) #push-options "--z3rlimit 16"
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "LowParse.Spec.BitVector.fst.checked", "LowParse.SLow.Int.fsti.checked", "LowParse.SLow.Combinators.fst.checked", "LowParse.SLow.BoundedInt.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.BitVector.fst.checked" ], "interface_file": false, "source_file": "LowParse.SLow.BitVector.fst" }
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.BitVector", "short_module": "BV" }, { "abbrev": false, "full_module": "LowParse.SLow.BoundedInt", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Int", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow.Combinators", "short_module": null }, { "abbrev": false, "full_module": "LowParse.Spec.BitVector", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "LowParse.SLow", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 16, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
min: Prims.nat -> max: Prims.nat{min <= max} -> hs32: LowParse.SLow.Base.serializer32 hs { Mkparser_kind'?.parser_kind_subkind hk == FStar.Pervasives.Native.Some LowParse.Spec.Base.ParserStrong /\ LowParse.SLow.Combinators.serialize32_kind_precond hk (LowParse.Spec.BitVector.parse_bounded_bv_payload_kind min max) } -> LowParse.SLow.Base.serializer32 (LowParse.Spec.BitVector.serialize_bounded_bv min max hs)
Prims.Tot
[ "total" ]
[]
[ "Prims.nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "LowParse.Spec.Base.parser_kind", "LowParse.Spec.Base.parser", "LowParse.Spec.BoundedInt.bounded_int32", "LowParse.Spec.Base.serializer", "LowParse.SLow.Base.serializer32", "Prims.l_and", "Prims.eq2", "FStar.Pervasives.Native.option", "LowParse.Spec.Base.parser_subkind", "LowParse.Spec.Base.__proj__Mkparser_kind'__item__parser_kind_subkind", "FStar.Pervasives.Native.Some", "LowParse.Spec.Base.ParserStrong", "LowParse.SLow.Combinators.serialize32_kind_precond", "LowParse.Spec.BitVector.parse_bounded_bv_payload_kind", "LowParse.SLow.Combinators.serialize32_dtuple2", "FStar.BitVector.bv_t", "FStar.UInt32.v", "LowParse.Spec.Base.weaken", "LowParse.Spec.BitVector.parse_bv_kind", "LowParse.Spec.BitVector.parse_bv", "LowParse.Spec.Combinators.serialize_weaken", "LowParse.Spec.BitVector.serialize_bv", "LowParse.SLow.Combinators.serialize32_weaken", "LowParse.SLow.BitVector.serialize32_bv", "LowParse.Spec.BitVector.parse_bounded_bv_kind", "LowParse.Spec.BitVector.bounded_bv_t", "LowParse.Spec.BitVector.parse_bounded_bv", "LowParse.Spec.BitVector.serialize_bounded_bv" ]
[]
false
false
false
false
false
let serialize32_bounded_bv (min: nat) (max: nat{min <= max}) (#hk: parser_kind) (#hp: parser hk (bounded_int32 min max)) (#hs: serializer hp) (hs32: serializer32 hs { hk.parser_kind_subkind == Some ParserStrong /\ serialize32_kind_precond hk (parse_bounded_bv_payload_kind min max) }) : Tot (serializer32 (serialize_bounded_bv min max hs)) =
serialize32_dtuple2 hs32 (fun (x: bounded_int32 min max) -> serialize32_weaken (parse_bounded_bv_payload_kind min max) (serialize32_bv (U32.v x)))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f_lemma
val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)))
val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)))
let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1)
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 76, "end_line": 259, "start_col": 0, "start_line": 253 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> j: Lib.IntTypes.size_nat{j < nLen} -> cres0: (Hacl.Spec.Bignum.Base.carry t * Hacl.Spec.Bignum.Definitions.lbignum t (nLen + nLen)) -> FStar.Pervasives.Lemma (ensures (let _ = cres0 in (let FStar.Pervasives.Native.Mktuple2 #_ #_ c0 res0 = _ in let _ = Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f n mu j (c0, res0) in (let FStar.Pervasives.Native.Mktuple2 #_ #_ c2 res = _ in let qj = mu *. res0.[ j ] in Hacl.Spec.Bignum.Definitions.bn_v res + Lib.IntTypes.v c2 * Prims.pow2 (Lib.IntTypes.bits t * (nLen + j + 1)) == Hacl.Spec.Bignum.Definitions.bn_v res0 + (Hacl.Spec.Bignum.Definitions.bn_v n * Lib.IntTypes.v qj) * Prims.pow2 (Lib.IntTypes.bits t * j) + Lib.IntTypes.v c0 * Prims.pow2 (Lib.IntTypes.bits t * (nLen + j))) <: Type0) <: Type0))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Prims.op_LessThan", "FStar.Pervasives.Native.tuple2", "Hacl.Spec.Bignum.Base.carry", "Hacl.Spec.Bignum.Definitions.bn_eval_extensionality_j", "Prims.op_Subtraction", "Lib.Sequence.slice", "Prims.unit", "Hacl.Spec.Bignum.Definitions.bn_eval_split_i", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f_eval_lemma", "FStar.Pervasives.Native.Mktuple2", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_f" ]
[]
false
false
true
false
false
let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) =
let c2, res = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.eq_slice
val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len)
val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len)
let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len)
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 44, "end_line": 165, "start_col": 0, "start_line": 158 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len)
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
b1: Lib.Sequence.lseq a len -> b2: Lib.Sequence.lseq a len -> i: Prims.nat -> j: Prims.nat{i <= j /\ j <= len} -> FStar.Pervasives.Lemma (requires Lib.Sequence.slice b1 i len == Lib.Sequence.slice b2 i len) (ensures Lib.Sequence.slice b1 j len == Lib.Sequence.slice b2 j len)
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Lib.IntTypes.size_nat", "Lib.Sequence.lseq", "Prims.nat", "Prims.l_and", "Prims.b2t", "Prims.op_LessThanOrEqual", "Lib.Sequence.eq_intro", "Prims.op_Subtraction", "Lib.Sequence.slice", "Prims.unit", "FStar.Classical.forall_intro", "Prims.op_LessThan", "Prims.eq2", "Prims.l_or", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.Sequence.index", "Prims.l_True", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern", "FStar.Seq.Base.lemma_index_slice", "Prims.op_Addition" ]
[]
false
false
true
false
false
let eq_slice #a #len b1 b2 i j =
let aux (k: nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len)
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_from_mont_lemma
val bn_from_mont_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu) (ensures (let a = bn_v (bn_from_mont n mu aM) in a == M.from_mont (bits t) nLen (bn_v n) (v mu) (bn_v aM) /\ a < bn_v n))
val bn_from_mont_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu) (ensures (let a = bn_v (bn_from_mont n mu aM) in a == M.from_mont (bits t) nLen (bn_v n) (v mu) (bn_v aM) /\ a < bn_v n))
let bn_from_mont_lemma #t #nLen n mu aM = let r = pow2 (bits t * nLen) in let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_eval_update_sub nLen aM (nLen + nLen); assert (bn_v tmp == bn_v aM); bn_eval_bound aM nLen; assert (bn_v tmp < r); let a = bn_mont_reduction n mu tmp in bn_mont_reduction_lemma n mu tmp; assert (bn_v a == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v tmp))
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 78, "end_line": 435, "start_col": 0, "start_line": 424 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2) let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM) let bn_to_mont_lemma #t #nLen n mu r2 a = let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in // c = a * r2 BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in // aM = c % n bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu) (ensures (let a = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_from_mont n mu aM) in a == Hacl.Spec.Montgomery.Lemmas.from_mont (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v aM) /\ a < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Prims._assert", "Prims.eq2", "Prims.nat", "Hacl.Spec.Bignum.Definitions.bn_v", "Hacl.Spec.Montgomery.Lemmas.mont_reduction", "Lib.IntTypes.bits", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Prims.unit", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_lemma", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction", "Prims.op_LessThan", "Hacl.Spec.Bignum.Definitions.bn_eval_bound", "Hacl.Spec.Bignum.Definitions.bn_eval_update_sub", "Lib.Sequence.lseq", "Prims.l_and", "Lib.Sequence.sub", "Prims.l_Forall", "Prims.l_or", "FStar.Seq.Base.index", "Lib.Sequence.to_seq", "Lib.Sequence.index", "Lib.Sequence.update_sub", "FStar.Seq.Base.seq", "FStar.Seq.Base.create", "Lib.IntTypes.mk_int", "Prims.l_imp", "Lib.Sequence.create", "Lib.IntTypes.uint", "Prims.pos", "Prims.pow2", "FStar.Mul.op_Star" ]
[]
true
false
true
false
false
let bn_from_mont_lemma #t #nLen n mu aM =
let r = pow2 (bits t * nLen) in let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_eval_update_sub nLen aM (nLen + nLen); assert (bn_v tmp == bn_v aM); bn_eval_bound aM nLen; assert (bn_v tmp < r); let a = bn_mont_reduction n mu tmp in bn_mont_reduction_lemma n mu tmp; assert (bn_v a == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v tmp))
false
Hacl.Spec.Bignum.Montgomery.fst
Hacl.Spec.Bignum.Montgomery.bn_mont_mul_lemma
val bn_mont_mul_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v aM < bn_v n /\ bn_v bM < bn_v n) (ensures (let res = bn_v (bn_mont_mul n mu aM bM) in res == M.mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v bM) /\ res < bn_v n))
val bn_mont_mul_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> aM:lbignum t nLen -> bM:lbignum t nLen -> Lemma (requires bn_mont_pre n mu /\ bn_v aM < bn_v n /\ bn_v bM < bn_v n) (ensures (let res = bn_v (bn_mont_mul n mu aM bM) in res == M.mont_mul (bits t) nLen (bn_v n) (v mu) (bn_v aM) (bn_v bM) /\ res < bn_v n))
let bn_mont_mul_lemma #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); Math.Lemmas.lemma_mult_lt_sqr (bn_v aM) (bn_v bM) (bn_v n); assert (bn_v c < bn_v n * bn_v n); bn_eval_bound n nLen; bn_mont_reduction_lemma n mu c
{ "file_name": "code/bignum/Hacl.Spec.Bignum.Montgomery.fst", "git_rev": "eb1badfa34c70b0bbe0fe24fe0f49fb1295c7872", "git_url": "https://github.com/project-everest/hacl-star.git", "project_name": "hacl-star" }
{ "end_col": 32, "end_line": 445, "start_col": 0, "start_line": 438 }
module Hacl.Spec.Bignum.Montgomery open FStar.Mul open Lib.IntTypes open Lib.Sequence open Hacl.Spec.Bignum.Base open Hacl.Spec.Bignum.Definitions module Loops = Lib.LoopCombinators module BN = Hacl.Spec.Bignum module BI = Hacl.Spec.Bignum.ModInvLimb #reset-options "--z3rlimit 100 --fuel 0 --ifuel 0" let bn_check_modulus #t #nLen n = let one = BN.bn_from_uint nLen (uint #t 1) in BN.bn_from_uint_lemma nLen (uint #t 1); let bit0 = BN.bn_is_odd n in BN.bn_is_odd_lemma n; assert (v bit0 == bn_v n % 2); let m0 = uint #t 0 -. bit0 in assert (v m0 == (if bn_v n % 2 = 1 then v (ones t SEC) else v (zeros t SEC))); let m1 = BN.bn_lt_mask one n in BN.bn_lt_mask_lemma one n; assert (v m1 == (if 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); let m = m0 &. m1 in logand_lemma m0 m1; assert (v m == (if bn_v n % 2 = 1 && 1 < bn_v n then v (ones t SEC) else v (zeros t SEC))); m val bn_lshift1_mod_n: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> lbignum t len let bn_lshift1_mod_n #t #len n i b = BN.bn_add_mod_n n b b val bn_lshift1_mod_n_lemma: #t:limb_t -> #len:size_nat -> n:lbignum t len -> i:nat -> b:lbignum t len -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (bn_lshift1_mod_n n i b) == 2 * bn_v b % bn_v n) let bn_lshift1_mod_n_lemma #t #len n i b = BN.bn_add_mod_n_lemma n b b val bn_mul_by_pow2: #t:limb_t -> len:size_nat -> n:lbignum t len -> b:lbignum t len -> k:nat -> Lemma (requires 0 < bn_v n /\ bn_v b < bn_v n) (ensures bn_v (Loops.repeati k (bn_lshift1_mod_n n) b) == pow2 k * bn_v b % bn_v n) let rec bn_mul_by_pow2 #t len n b k = if k = 0 then Loops.eq_repeati0 k (bn_lshift1_mod_n n) b else begin let res = Loops.repeati k (bn_lshift1_mod_n n) b in let res0 = Loops.repeati (k - 1) (bn_lshift1_mod_n n) b in bn_mul_by_pow2 len n b (k - 1); assert (bn_v res0 == pow2 (k - 1) * bn_v b % bn_v n); Loops.unfold_repeati k (bn_lshift1_mod_n n) b (k - 1); assert (res == bn_lshift1_mod_n n (k - 1) res0); bn_lshift1_mod_n_lemma n (k - 1) res0; assert (bn_v res == 2 * (pow2 (k - 1) * bn_v b % bn_v n) % bn_v n); Math.Lemmas.lemma_mod_mul_distr_r 2 (pow2 (k - 1) * bn_v b) (bn_v n); assert (bn_v res == 2 * pow2 (k - 1) * bn_v b % bn_v n); Math.Lemmas.pow2_plus 1 (k - 1) end let bn_precomp_r2_mod_n #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in // c0 == pow2 nBits // pow2 (2 * bits t * nLen) / pow2 nBits == pow2 (2 * bits t * nLen - nBits) Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 let bn_precomp_r2_mod_n_lemma #t #nLen nBits n = let c = create nLen (uint #t 0) in let c0 = BN.bn_set_ith_bit c nBits in bn_eval_zeroes #t nLen nLen; BN.bn_set_ith_bit_lemma c nBits; assert (bn_v c0 == pow2 nBits); let res = Loops.repeati (2 * bits t * nLen - nBits) (bn_lshift1_mod_n n) c0 in bn_mul_by_pow2 nLen n c0 (2 * bits t * nLen - nBits); assert (bn_v res == pow2 (2 * bits t * nLen - nBits) * pow2 nBits % bn_v n); Math.Lemmas.pow2_plus (2 * bits t * nLen - nBits) nBits; assert (bn_v res == pow2 (2 * bits t * nLen) % bn_v n) let bn_mont_precomp #t #nLen nBits n = let r2 = bn_precomp_r2_mod_n nBits n in bn_precomp_r2_mod_n_lemma nBits n; let mu = BI.mod_inv_limb n.[0] in BI.bn_mod_inv_limb_lemma n; bn_eval_bound n nLen; r2, mu /// Low-level specification of Montgomery arithmetic val bn_mont_reduction_f: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> tuple2 (carry t) (lbignum t (nLen + nLen)) -> tuple2 (carry t) (lbignum t (nLen + nLen)) let bn_mont_reduction_f #t #nLen n mu j (c0, acc) = let qj = mu *. acc.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j acc in let c2, r = addcarry c0 c1 res1.[nLen + j] in let res = res1.[nLen + j] <- r in c2, res let bn_mont_reduction_t (#t:limb_t) (#nLen:size_nat{nLen + nLen <= max_size_t}) (j:size_nat{j <= nLen}) = tuple2 (carry t) (lbignum t (nLen + nLen)) val bn_mont_reduction_loop_div_r: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> c:lbignum t (nLen + nLen) -> carry t & lbignum t nLen let bn_mont_reduction_loop_div_r #t #nLen n mu c = let (c0, c) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, c) in let res = BN.bn_rshift c nLen in c0, res let bn_mont_reduction #t #nLen n mu c = let c0, res = bn_mont_reduction_loop_div_r #t #nLen n mu c in BN.bn_reduce_once n c0 res let bn_to_mont #t #nLen n mu r2 a = let c = BN.bn_mul a r2 in // c = a * r2 bn_mont_reduction n mu c // aM = c % n let bn_from_mont #t #nLen n mu aM = let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_mont_reduction n mu tmp let bn_mont_mul #t #nLen n mu aM bM = let c = BN.bn_mul aM bM in // c = aM * bM bn_mont_reduction n mu c // resM = c % n let bn_mont_sqr #t #nLen n mu aM = let c = BN.bn_mul aM aM in // c = aM * aM bn_mont_reduction n mu c // resM = c % n let bn_mont_one #t #nLen n mu r2 = bn_from_mont n mu r2 val eq_slice: #a:Type0 -> #len:size_nat -> b1:lseq a len -> b2:lseq a len -> i:nat -> j:nat{i <= j /\ j <= len} -> Lemma (requires slice b1 i len == slice b2 i len) (ensures slice b1 j len == slice b2 j len) let eq_slice #a #len b1 b2 i j = let aux (k:nat{k < len - j}) : Lemma (index (slice b1 j len) k == index (slice b2 j len) k) = Seq.lemma_index_slice b1 i len (k + j - i); Seq.lemma_index_slice b2 i len (k + j - i); () in Classical.forall_intro aux; eq_intro (slice b1 j len) (slice b2 j len) val bn_mont_reduction_f_eval_lemma_aux: pbits:pos -> er0:nat -> rj:nat -> nLen:nat -> n:nat -> qj:nat -> j:nat -> c0:nat -> c1:nat -> c2:nat -> Lemma (let p = pow2 (pbits * (nLen + j)) in er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits) == er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - pow2 (pbits * (nLen + j + 1)) * c2) let bn_mont_reduction_f_eval_lemma_aux pbits er0 rj nLen n qj j c0 c1 c2 = let p = pow2 (pbits * (nLen + j)) in calc (==) { er0 + n * qj * pow2 (pbits * j) - c1 * p + p * (c0 + c1 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p c1 (c0 + rj - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) - c1 * p + p * c1 + p * (c0 + rj - c2 * pow2 pbits); (==) { } er0 + n * qj * pow2 (pbits * j) + p * (c0 + rj - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_add_right p rj (c0 - c2 * pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * (c0 - c2 * pow2 pbits); (==) { Math.Lemmas.distributivity_sub_right p c0 (c2 * pow2 pbits); Math.Lemmas.paren_mul_right p c2 (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - p * c2 * pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen + j)) pbits; Math.Lemmas.paren_mul_right c2 p (pow2 pbits) } er0 + n * qj * pow2 (pbits * j) + p * rj + p * c0 - c2 * pow2 (pbits * (nLen + j + 1)); } val bn_mont_reduction_f_eval_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in eval_ (nLen + nLen) res (nLen + j + 1) + v c2 * pow2 (bits t * (nLen + j + 1)) == eval_ (nLen + nLen) res0 (nLen + j + 1) + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j)) /\ slice res (nLen + j + 1) (nLen + nLen) == slice res0 (nLen + j + 1) (nLen + nLen)) let bn_mont_reduction_f_eval_lemma #t #nLen n mu j (c0, res0) = let pbits = bits t in let p = pow2 (pbits * (nLen + j)) in let resLen = nLen + nLen in let qj = mu *. res0.[j] in let c1, res1 = BN.bn_mul1_lshift_add n qj j res0 in BN.bn_mul1_lshift_add_lemma n qj j res0; assert (v c1 * p + eval_ resLen res1 (nLen + j) == eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j)); let c2, r = addcarry c0 c1 res1.[nLen + j] in assert (v r + v c2 * pow2 pbits == v c0 + v c1 + v res1.[nLen + j]); let res = res1.[nLen + j] <- r in bn_eval_extensionality_j res res1 (nLen + j); assert (eval_ resLen res (nLen + j) == eval_ resLen res1 (nLen + j)); bn_eval_unfold_i res (nLen + j + 1); assert (eval_ resLen res (nLen + j + 1) == eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]); calc (==) { eval_ resLen res1 (nLen + j) + p * v res.[nLen + j]; (==) { } eval_ resLen res0 (nLen + j) + bn_v n * v qj * pow2 (pbits * j) - v c1 * p + p * (v c0 + v c1 + v res1.[nLen + j] - v c2 * pow2 pbits); (==) { bn_mont_reduction_f_eval_lemma_aux pbits (eval_ resLen res0 (nLen + j)) (v res1.[nLen + j]) nLen (bn_v n) (v qj) j (v c0) (v c1) (v c2) } eval_ resLen res0 (nLen + j) + p * v res1.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { Seq.lemma_index_slice res1 (nLen + j) resLen 0 } eval_ resLen res0 (nLen + j) + p * v res0.[nLen + j] + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; (==) { bn_eval_unfold_i res0 (nLen + j + 1) } eval_ resLen res0 (nLen + j + 1) + bn_v n * v qj * pow2 (pbits * j) + p * v c0 - pow2 (pbits * (nLen + j + 1)) * v c2; }; eq_slice res0 res1 (nLen + j) (nLen + j + 1); eq_intro (slice res (nLen + j + 1) (nLen + nLen)) (slice res0 (nLen + j + 1) (nLen + nLen)) val bn_mont_reduction_f_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen -> mu:limb t -> j:size_nat{j < nLen} -> cres0:tuple2 (carry t) (lbignum t (nLen + nLen)) -> Lemma ( let (c0, res0) = cres0 in let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in let qj = mu *. res0.[j] in bn_v res + v c2 * pow2 (bits t * (nLen + j + 1)) == bn_v res0 + bn_v n * v qj * pow2 (bits t * j) + v c0 * pow2 (bits t * (nLen + j))) let bn_mont_reduction_f_lemma #t #nLen n mu j (c0, res0) = let (c2, res) = bn_mont_reduction_f n mu j (c0, res0) in bn_mont_reduction_f_eval_lemma n mu j (c0, res0); bn_eval_split_i res (nLen + j + 1); bn_eval_split_i res0 (nLen + j + 1); bn_eval_extensionality_j res (slice res 0 (nLen + j + 1)) (nLen + j + 1); bn_eval_extensionality_j res0 (slice res0 0 (nLen + j + 1)) (nLen + j + 1) val bn_mont_reduction_loop_step_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j < nLen} -> c1:carry t -> res1:lbignum t (nLen + nLen) -> resM1:nat -> Lemma (requires v c1 * pow2 (bits t * (nLen + j)) + bn_v res1 == resM1) (ensures (let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f (bits t) nLen (bn_v n) (v mu) j resM1 in v c2 * pow2 (bits t * (nLen + j + 1)) + bn_v res == resM)) let bn_mont_reduction_loop_step_lemma #t #nLen n mu j c1 res1 resM1 = let pbits = bits t in let (c2, res) = bn_mont_reduction_f n mu j (c1, res1) in let resM = M.mont_reduction_f pbits nLen (bn_v n) (v mu) j resM1 in bn_mont_reduction_f_lemma n mu j (c1, res1); let qj = mu *. res1.[j] in assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == bn_v res1 + bn_v n * v qj * pow2 (pbits * j) + v c1 * pow2 (pbits * (nLen + j))); bn_eval_index res1 j; assert (v res1.[j] == bn_v res1 / pow2 (pbits * j) % pow2 pbits); assert (v qj == v mu * v res1.[j] % pow2 pbits); assert (bn_v res + v c2 * pow2 (pbits * (nLen + j + 1)) == resM1 + bn_v n * v qj * pow2 (pbits * j)); let cjM = resM1 / pow2 (pbits * j) % pow2 pbits in let qjM = v mu * cjM % pow2 pbits in assert (resM == resM1 + bn_v n * qjM * pow2 (pbits * j)); calc (==) { (v c1 * pow2 (pbits * (nLen + j)) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * j) } (v c1 * pow2 (pbits * nLen) * pow2 (pbits * j) + bn_v res1) / pow2 (pbits * j) % pow2 pbits; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (pow2 (pbits * j)) (v c1 * pow2 (pbits * nLen)) } (v c1 * pow2 (pbits * nLen) + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.pow2_plus (pbits * (nLen - 1)) pbits } (v c1 * pow2 (pbits * (nLen - 1)) * pow2 pbits + bn_v res1 / pow2 (pbits * j)) % pow2 pbits; (==) { Math.Lemmas.modulo_addition_lemma (bn_v res1 / pow2 (pbits * j)) (pow2 pbits) (v c1 * pow2 (pbits * (nLen - 1))) } (bn_v res1 / pow2 (pbits * j)) % pow2 pbits; } val bn_mont_reduction_loop_lemma: #t:limb_t -> #nLen:size_nat{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> j:size_nat{j <= nLen} -> res0:lbignum t (nLen + nLen) -> Lemma ( let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f (bits t) nLen (bn_v n) (v mu)) (bn_v res0) in v c2 * pow2 (bits t * (nLen + j)) + bn_v res == resM) let rec bn_mont_reduction_loop_lemma #t #nLen n mu j res0 = let pbits = bits t in let (c2, res) = Loops.repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM = Loops.repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in if j = 0 then begin Loops.eq_repeati0 j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0); Loops.eq_repeat_gen0 j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0); () end else begin let (c1, res1) = Loops.repeat_gen (j - 1) bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM1 = Loops.repeati (j - 1) (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in Loops.unfold_repeat_gen j bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) (j - 1); assert ((c2, res) == bn_mont_reduction_f n mu (j - 1) (c1, res1)); Loops.unfold_repeati j (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) (j - 1); assert (resM == M.mont_reduction_f pbits nLen (bn_v n) (v mu) (j - 1) resM1); bn_mont_reduction_loop_lemma n mu (j - 1) res0; assert (v c1 * pow2 (pbits * (nLen + j - 1)) + bn_v res1 == resM1); bn_mont_reduction_loop_step_lemma n mu (j - 1) c1 res1 resM1; () end val bn_mont_reduction_loop_div_r_lemma: #t:limb_t -> #nLen:size_pos{nLen + nLen <= max_size_t} -> n:lbignum t nLen{0 < bn_v n} -> mu:limb t -> c:lbignum t (nLen + nLen) -> Lemma (let (c2, res) = bn_mont_reduction_loop_div_r #t #nLen n mu c in let resM = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v c) in v c2 * pow2 (bits t * nLen) + bn_v res == resM) let bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let resLen = nLen + nLen in let (c0, res1) = Loops.repeat_gen nLen bn_mont_reduction_t (bn_mont_reduction_f n mu) (uint #t 0, res0) in let resM : nat = Loops.repeati nLen (M.mont_reduction_f pbits nLen (bn_v n) (v mu)) (bn_v res0) in bn_mont_reduction_loop_lemma n mu nLen res0; assert (v c0 * pow2 (pbits * resLen) + bn_v res1 == resM); let res2 = BN.bn_rshift res1 nLen in BN.bn_rshift_lemma res1 nLen; assert (bn_v res2 == bn_v res1 / r); calc (==) { // resM / r = (v c0 * pow2 (pbits * resLen) + bn_v res1) / r; (==) { Math.Lemmas.pow2_plus (pbits * nLen) (pbits * nLen) } (v c0 * r * r + bn_v res1) / r; (==) { Math.Lemmas.division_addition_lemma (bn_v res1) (r) (v c0 * r) } v c0 * r + bn_v res1 / r; (==) { } v c0 * r + bn_v res2; }; assert (resM / r == v c0 * r + bn_v res2) let bn_mont_reduction_lemma #t #nLen n mu res0 = let pbits = bits t in let r = pow2 (pbits * nLen) in let c0, res1 = bn_mont_reduction_loop_div_r #t #nLen n mu res0 in bn_mont_reduction_loop_div_r_lemma #t #nLen n mu res0; M.mont_reduction_loop_div_r_fits_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (v c0 * r + bn_v res1 <= (bn_v res0 - bn_v n) / r + bn_v n); M.lemma_fits_c_lt_rn (bn_v res0) r (bn_v n); assert (v c0 * r + bn_v res1 < 2 * bn_v n); let res2 = BN.bn_reduce_once n c0 res1 in BN.bn_reduce_once_lemma n c0 res1; assert (bn_v res2 == (v c0 * r + bn_v res1) % bn_v n); let resM = M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v res0) in let d, _ = M.eea_pow2_odd (pbits * nLen) (bn_v n) in M.mont_reduction_lemma (bits t) nLen (bn_v n) (v mu) (bn_v res0); assert (resM == bn_v res0 * d % bn_v n); let resM1 = M.mont_reduction_loop_div_r (bits t) nLen (bn_v n) (v mu) (bn_v res0) in //assert (resM == (if resM1 < bn_v n then resM1 else resM1 - bn_v n)); //assert (bn_v res2 == resM1 % bn_v n); if resM1 < bn_v n then begin //resM % bn_v n == resM1 % bn_v n ==> bn_v res2 == resM % bn_v Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end else begin //resM % bn_v n == (resM1 - bn_v n) % bn_v n == resM1 % bn_v n Math.Lemmas.lemma_mod_sub resM1 (bn_v n) 1; assert (resM % bn_v n == resM1 % bn_v n); Math.Lemmas.small_mod resM (bn_v n); assert (bn_v res2 == resM) end; assert (bn_v res2 == resM) let bn_to_mont_lemma #t #nLen n mu r2 a = let r = pow2 (bits t * nLen) in let c = BN.bn_mul a r2 in // c = a * r2 BN.bn_mul_lemma a r2; bn_eval_bound a nLen; M.mult_lt_lemma (bn_v a) (bn_v r2) r (bn_v n); assert (bn_v c < r * bn_v n); let aM = bn_mont_reduction n mu c in // aM = c % n bn_mont_reduction_lemma n mu c; assert (bn_v aM == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v c)) let bn_from_mont_lemma #t #nLen n mu aM = let r = pow2 (bits t * nLen) in let tmp = create (nLen + nLen) (uint #t 0) in let tmp = update_sub tmp 0 nLen aM in bn_eval_update_sub nLen aM (nLen + nLen); assert (bn_v tmp == bn_v aM); bn_eval_bound aM nLen; assert (bn_v tmp < r); let a = bn_mont_reduction n mu tmp in bn_mont_reduction_lemma n mu tmp; assert (bn_v a == M.mont_reduction (bits t) nLen (bn_v n) (v mu) (bn_v tmp))
{ "checked_file": "/", "dependencies": [ "prims.fst.checked", "Lib.Sequence.fsti.checked", "Lib.LoopCombinators.fsti.checked", "Lib.IntTypes.fsti.checked", "Hacl.Spec.Bignum.ModInvLimb.fsti.checked", "Hacl.Spec.Bignum.Definitions.fst.checked", "Hacl.Spec.Bignum.Base.fst.checked", "Hacl.Spec.Bignum.fsti.checked", "FStar.Seq.fst.checked", "FStar.Pervasives.Native.fst.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Classical.fsti.checked", "FStar.Calc.fsti.checked" ], "interface_file": true, "source_file": "Hacl.Spec.Bignum.Montgomery.fst" }
[ { "abbrev": true, "full_module": "Hacl.Spec.Bignum.ModInvLimb", "short_module": "BI" }, { "abbrev": true, "full_module": "Hacl.Spec.Bignum", "short_module": "BN" }, { "abbrev": true, "full_module": "Lib.LoopCombinators", "short_module": "Loops" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Base", "short_module": null }, { "abbrev": true, "full_module": "Hacl.Spec.Montgomery.Lemmas", "short_module": "M" }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum.Definitions", "short_module": null }, { "abbrev": false, "full_module": "Lib.Sequence", "short_module": null }, { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "Hacl.Spec.Bignum", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 100, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
false
n: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> mu: Hacl.Spec.Bignum.Definitions.limb t -> aM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> bM: Hacl.Spec.Bignum.Definitions.lbignum t nLen -> FStar.Pervasives.Lemma (requires Hacl.Spec.Bignum.Montgomery.bn_mont_pre n mu /\ Hacl.Spec.Bignum.Definitions.bn_v aM < Hacl.Spec.Bignum.Definitions.bn_v n /\ Hacl.Spec.Bignum.Definitions.bn_v bM < Hacl.Spec.Bignum.Definitions.bn_v n) (ensures (let res = Hacl.Spec.Bignum.Definitions.bn_v (Hacl.Spec.Bignum.Montgomery.bn_mont_mul n mu aM bM) in res == Hacl.Spec.Montgomery.Lemmas.mont_mul (Lib.IntTypes.bits t) nLen (Hacl.Spec.Bignum.Definitions.bn_v n) (Lib.IntTypes.v mu) (Hacl.Spec.Bignum.Definitions.bn_v aM) (Hacl.Spec.Bignum.Definitions.bn_v bM) /\ res < Hacl.Spec.Bignum.Definitions.bn_v n))
FStar.Pervasives.Lemma
[ "lemma" ]
[]
[ "Hacl.Spec.Bignum.Definitions.limb_t", "Lib.IntTypes.size_pos", "Prims.b2t", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "Lib.IntTypes.max_size_t", "Hacl.Spec.Bignum.Definitions.lbignum", "Hacl.Spec.Bignum.Definitions.limb", "Hacl.Spec.Bignum.Montgomery.bn_mont_reduction_lemma", "Prims.unit", "Hacl.Spec.Bignum.Definitions.bn_eval_bound", "Prims._assert", "Prims.op_LessThan", "Hacl.Spec.Bignum.Definitions.bn_v", "FStar.Mul.op_Star", "FStar.Math.Lemmas.lemma_mult_lt_sqr", "Prims.eq2", "Prims.int", "Hacl.Spec.Bignum.bn_mul_lemma", "Hacl.Spec.Bignum.bn_mul" ]
[]
true
false
true
false
false
let bn_mont_mul_lemma #t #nLen n mu aM bM =
let c = BN.bn_mul aM bM in BN.bn_mul_lemma aM bM; assert (bn_v c == bn_v aM * bn_v bM); Math.Lemmas.lemma_mult_lt_sqr (bn_v aM) (bn_v bM) (bn_v n); assert (bn_v c < bn_v n * bn_v n); bn_eval_bound n nLen; bn_mont_reduction_lemma n mu c
false